Codebase list python-faraday / upstream/3.0.1
New upstream version 3.0.1 Sophie Brun 5 years ago
95 changed file(s) with 3920 addition(s) and 3636 deletion(s). Raw diff Collapse all Expand all
6565 # Images based on DB Schema
6666 entity_dbschema.png
6767 uml_schema.png
68
69 # Documentation builds
70 doc/_build/
2121 * Andrés López Luksenberg
2222 * Andres Tarantini
2323 * Brice Samulenok
24 * Buanzo
25 * csk
26 * dmknght
2427 * Elian Gidoni
2528 * Endrigo Antonini
2629 * Federico Fernandez
2730 * James Jara
31 * Javier aguinaga
2832 * Jorge Luis Gonzalez Iznaga
2933 * Juan Urbano
3034 * Korantin Auguste
3135 * Martin Tartarelli
36 * Mike Zhong (go bears)
37 * Necrose99
3238 * Ronald Iraheta
3339 * Roberto Focke
3440 * Sliim
3642 * tsxltjecwb
3743 * Ulisses Albuquerque
3844 * xtr4nge
39 * Buanzo
40 * Necrose99
41 * csk
42 * Mike Zhong (go bears)
77 }
88
99 stage("Install Python Virtual Enviroment") {
10 sh "/usr/local/bin/virtualenv --no-site-packages ${ENV_PATH}"
10 sh "/usr/local/bin/virtualenv --no-site-packages ${ENV_PATH} --python=/usr/local/bin/python"
1111 }
1212
1313 // Get the latest version of our application code.
1919 sh """
2020 source ${ENV_PATH}/bin/activate
2121 pip install virtualenv responses
22 pip install 'Tornado<5.0.0'
23 pip install -r $WORKSPACE/requirements.txt
24 pip install -r $WORKSPACE/requirements_server.txt
25 pip install -r $WORKSPACE/requirements_extras.txt
26 pip install -r $WORKSPACE/requirements_dev.txt
22 pip install -U -r $WORKSPACE/requirements.txt
23 pip install -U -r $WORKSPACE/requirements_server.txt
24 pip install -U -r $WORKSPACE/requirements_extras.txt
25 pip install -U -r $WORKSPACE/requirements_dev.txt
2726 deactivate
2827 """
2928 }
8988
9089 }
9190 }
91
92 stage ("Build docs") {
93 sh """
94 source ${ENV_PATH}/bin/activate
95 pip install sphinx
96 mkdir -p ~/docs
97 rm -rf ~/docs/jenkins_build
98 cd $WORKSPACE/doc && make html && cp -r _build/html ~/docs/jenkins_build
99 """
100 }
101
102 stage ("Run Closure Compiler") {
103 try {
104 sh """
105 java -jar /home/faraday/closure-compiler-v20180610.jar $WORKSPACE/server/www/scripts
106 """
107 }
108 catch (err) {
109 currentBuild.result = 'FAILURE'
110 }
111 finally {
112 notifyBuild(currentBuild.result, "Closure compiler")
113 }
114 }
92115 }
93116
94117 def notifyBuild(String buildStatus = 'STARTED', String extraMessage = '') {
0 ![Faraday Logo](https://raw.github.com/wiki/infobyte/faraday/images/Faraday-Logo.png)
0 ## About
11
2 Faraday introduces a new concept - IPE (Integrated Penetration-Test Environment) a multiuser Penetration test IDE. Designed for distribution, indexation and analysis of the data generated during a security audit.
2 Faraday introduces a new concept - IPE (Integrated Penetration-Test Environment) a multiuser Penetration test IDE. Designed for distributing, indexing, and analyzing the data generated during a security audit.
33
4 The main purpose of Faraday is to re-use the available tools in the community to take advantage of them in a multiuser way.
4 > Made for true pentesters!
55
6 Designed for simplicity, users should notice no difference between their own terminal application and the one included in Faraday. Developed with a specialized set of functionalities that help users improve their own work. Do you remember yourself programming without an IDE? Well, Faraday does the same as an IDE does for you when programming, but from the perspective of a penetration test.
6 Faraday was made to let you take advantage of the available tools in the community in a truly multiuser way.
77
8 Please read the [RELEASE notes](https://github.com/infobyte/faraday/blob/master/RELEASE.md)!
8 Designed for simplicity, users should notice no difference between their own terminal application and the one included in Faraday. Developed with a specialized set of functionalities, users improve their own work. Do you remember the last time you programmed without an IDE? What IDEs are to programming, Faraday is to pentesting.
99
10 ![GUI - Web](https://raw.github.com/wiki/infobyte/faraday/images/GUI_Dashboard_new.png)
10 ![GUI - GTK](https://raw.github.com/wiki/infobyte/faraday/images/client/gtk_main_window.png)
1111
12 Plugins
13 ---
14 Don't change the way you work today! Faraday plays well with others, right now it has more than [50 supported tools](https://github.com/infobyte/faraday/wiki/Plugin-List), among them you will find:
12 Faraday crunches the data you load into different visualizations that are useful to managers and pentesters alike.
13
14 ![GUI - Web](https://raw.github.com/wiki/infobyte/faraday/images/dashboard/dashboard.png)
15
16 To read about the latest features check out the [release notes](https://github.com/infobyte/faraday/blob/master/RELEASE.md)!
17
18 ## Getting Started!
19
20 Check out our documentacion for datailed information on how to install Faraday in all of our supported platforms:
21
22 ![Supported Os](https://raw.github.com/wiki/infobyte/faraday/images/platform/supported.png)
23
24 To begin the instalation process check our out [First Step](https://raw.github.com/wiki/infobyte/faraday/First-steps) Wiki.
25
26 ## New Features!
27 All of Faraday's latest features and updates are always available on our [blog](http://blog.infobytesec.com/search/label/english).
28 There are new entries every few weeks, don't forget to check out our amaizing new improvements on it's last entry!
29
30
31 ## Plugins list
32
33 You feed data to Faraday from your favorite tools through Plugins. Right now there are more than [60+ supported tools](https://github.com/infobyte/faraday/wiki/Plugin-List), among which you will find:
1534
1635 ![](https://raw.github.com/wiki/infobyte/faraday/images/plugins/Plugins.png)
1736
18 There are 3 kind of plugins:
19 * Plugins that intercept commands, fired directly when a command is detected in the console. These are transparent to you and no additional action on your part is needed.
20 * Plugins that import file reports. You have to copy the report to **$HOME/.faraday/report/[workspacename]** (replacing **[workspacename]** with the actual name of your Workspace) and Faraday will automatically detect, process and add it to the HostTree.
21 * Plugin connectors or online (BeEF, Metasploit, Burp), these connect to external APIs or databases, or talk directly to Faraday's RPC API.
37 There are three Plugin types: **console** plugins which intercept and interpret the output of the tools you execute, **report** plugins which allows you to import previously generated XMLs, and **online** plugins which access Faraday's API or allow Faraday to connect to external APIs and databases.
2238
23 Getting started
24 ---
25 The following platforms are supported:
39 [Read more about Plugins](http://github.com/infobyte/faraday/wiki/Plugin-List).
2640
27 ![platform](https://raw.github.com/wiki/infobyte/faraday/images/platform/supported.png)
41 ## Features
2842
29 Read more about [supported platforms and installation specifics](https://github.com/infobyte/faraday/wiki/First-steps).
43 ### Workspaces
44 Information is organized into various **Workspaces**. Each Workspace contains a pentest team's assignments and all the intel that is discovered.
3045
31 #### Quick install
46 ### Conflicts
47 If two plugins produce clashing information for an individual element, a conflict that the user will have to resolve is generated. An example is if **user1** incorporates host *127.0.0.1 OS:Linux* and **user2** incorporates *127.0.0.1 OS: Linux Ubuntu 13.10*.
3248
33 This applies only to Debian, Ubuntu, Kali and Backtrack. For the full installation guide [visit our wiki](https://github.com/infobyte/faraday/wiki/First-steps).
49 On our [GTK interface](https://github.com/infobyte/faraday/wiki/Usage#gtk-gui) there's a button on the bottom right corner of the main window displaying the number of conflicts in the current workspace. To resolve them, just click on the button and a window will open where you can edit the conflicting objects and select which one to keep.
3450
35 Download the [latest tarball](https://github.com/infobyte/faraday/tarball/master) or clone our repo:
51 ### Faraday plugin
3652
37 ```
38 $ git clone https://github.com/infobyte/faraday.git faraday-dev
39 $ cd faraday-dev
40 $ ./install.sh
41 $ ./faraday-server.py
42 $ ./faraday.py
43 ```
53 Using our plugin you can perform various actions using the command line, for example:
4454
45 More about Faraday
46 ---
47 Want to read more about the project? Try our [wiki](https://github.com/infobyte/faraday/wiki).
55 $ cd faraday-dev/bin/
56 $ ./fplugin create_host 192.154.33.222 Android
57 1a7b2981c7becbcb3d5318056eb29a58817f5e67
58 $ ./fplugin filter_services http ssh -p 21 -a
59 Filtering services for ports: 21, 22, 80, 443, 8080, 8443
4860
49 Already a user and have a question or bug report? Check out our [FAQ](https://github.com/infobyte/faraday/wiki/FAQ) and [troubleshooting](https://github.com/infobyte/faraday/wiki/troubleshooting) pages. If you're still having troubles you can [open a ticket](https://github.com/infobyte/faraday/issues/new).
61 192.168.20.1 ssh [22] tcp open None
62 192.168.20.1 http [443] tcp open None
63 192.168.20.7 ssh [22] tcp open Linux
64 192.168.20.7 http [443] tcp open Linux
65 192.168.20.11 ssh [22] tcp open Linux
5066
51 Join our community! Subscribe to our [mailing list](https://groups.google.com/forum/#!forum/faradaysec) or find us on Twitter [@faradaysec](https://twitter.com/faradaysec)
5267
53 Do you have a question? Troubleshooting? Joing our IRC channel #faraday-dev in [freenode](ircs://irc.freenode.net/faraday-dev) or access directly from this link: [![Visit our IRC channel](https://kiwiirc.com/buttons/irc.freenode.org/faraday-dev.png)](https://kiwiirc.com/client/irc.freenode.org/?nick=faraday_gi|?#faraday-dev)
68 Read more about the [Faraday Plugin](https://github.com/infobyte/faraday/wiki/faraday-plugin).
5469
70 ### Notifications
71 Updating objects on other Faraday instances result in notifications on your
72 Faraday GTK Client.
73
74 ![](https://raw.github.com/wiki/infobyte/faraday/images/client/gtk_notifications_dialog.png)
75
76
77 ### CSV Exporting
78 Faraday supports CSV Exporting from its WEB UI.
79 [More information](Exporting-the-information)
80
81 ## Links
82
83 * Homepage: https://www.faradaysec.com
84 * User forum: https://forum.faradaysec.com
85 * User's manual: https://github.com/infobyte/faraday/wiki
86 * Download: [.tar.gz](https://github.com/infobyte/faraday/tarball/master)
87 * Commits RSS feed: https://github.com/infobyte/faraday/commits/master.atom
88 * Issue tracker: https://github.com/infobyte/faraday/issues
89 * Frequently Asked Questions (FAQ): https://github.com/infobyte/faraday/wiki/FAQ
90 * Mailing list subscription: https://groups.google.com/forum/#!forum/faradaysec
91 * Twitter: [@faradaysec](https://twitter.com/faradaysec)
92 * [Demos](https://github.com/infobyte/faraday/wiki/Demos)
93 * IRC: [ircs://irc.freenode.net/faraday-dev](ircs://irc.freenode.net/faraday-dev) [WebClient](https://webchat.freenode.net/?nick=wikiuser&channels=faraday-dev&prompt=1&uio=d4)
94 * Screenshots: https://github.com/infobyte/faraday/wiki/Screenshots
95 * Send your ideas and suggestions here: [https://www.faradaysec.com/ideas](https://www.faradaysec.com/ideas)
96
97 ## Presentations
98
99 * Ekoparty Security Conference - 2017:
100 * http://blog.infobytesec.com/2017/10/ekoparty-2017-review_23.html
101
102 * Black Hat Arsenal Asia - 2017:
103 * https://www.blackhat.com/asia-17/arsenal.html#faraday
104
105 * Zero Nights - 2016
106 * https://www.slideshare.net/AlexanderLeonov2/enterprise-vulnerability-management-zeronights16
107
108 * AV Tokio - 2016:
109 * http://en.avtokyo.org/avtokyo2016/event
110
111 * Black Hat Arsenal USA - 2016:
112
113 * https://www.blackhat.com/us-16/arsenal.html#faraday
114
115 * Black Hat Arsenal Europe - 2016
116 * https://www.blackhat.com/eu-16/arsenal.html#faraday
117
118 * SecurityWeekly - 2016:
119 * http://securityweekly.com/2016/08/02/security-weekly-475-federico-kirschbaum/
120
121 * Bsides Latam - 2016:
122 * http://www.infobytesec.com/down/Faraday_BsideLatam_2016.pdf
123
124 * Black Hat Arsenal Asia - 2016:
125 * https://www.blackhat.com/asia-16/arsenal.html#faraday
126
127 * Black Hat Arsenal Europe - 2015:
128 * https://www.blackhat.com/eu-15/arsenal.html#faraday
129
130 * Black Hat Arsenal USA - 2015:
131 * https://www.blackhat.com/us-15/arsenal.html#faraday
132 * http://blog.infobytesec.com/2015/08/blackhat-2015_24.html
133
134 * RSA - 2015:
135 * http://www.rsaconference.com/events/us15/expo-sponsors/exhibitor-list/1782/infobyte-llc
136 * http://blog.infobytesec.com/2015/05/infobyte-en-la-rsa-2015.html
137
138 * Ekoparty Security Conference - 2014:
139 * https://www.youtube.com/watch?v=_j0T2S6Ppfo
140
141 * Black Hat Arsenal - 2011
142 * http://www.infobytesec.com/down/Faraday_BH2011_Arsenal.pdf
143
144 * Ekoparty Security Conference - 2010:
145 * http://prezi.com/fw46zt6_zgi8/faraday/
146 * http://vimeo.com/16516987
77 New features in the latest update
88 =====================================
99
10 TBA:
10 August 17, 2018:
11 ---
12 * Updated code to use Flask 1.0
13 * Add threadfix integration (corp only)
14 * Fix create_service fplugin
15 * Executive report bug fix on tags
16 * Persistence server bug fix on impact and ease of resolution
17 * Fix unicode error bug on executive reports
18 * Updated code to support latest Twisted version
19 * Updated all requirements to use >=
20 * Fix dry run on create_host fplugin
21 * Fixed del_all_vulns_with and del_all_hosts
22 * Improved executive reports status update refresh
23 * Websocket port is configurable now
24 * Change minimum font size in tag cloud
25 * Fixed a problem with shodan icon on dashboard
26 * Updated license check on deleted users
27 * Users with role client was not able to change password, bug fixed
28 * Updated code to support pip 10
29 * Added ldap to status check
30 * Credentials icon aligned
31 * Deamon now allows to execute faraday sever in more than one port and more than one process for multiplexation
32 * All views now check for permissions on workspace
33 * Pull requests #229, #231, #239 and #240 are merged
34 * Avoid polling deleted executive reports
35 * Added documentation to project
36 * Fix self xss on webshell
37 * Add postgres locks check on status_check
38 * Vuln counter fix when confirmed is on
39
40 July 26, 2018:
1141 ---
1242 * Interface removed from model and from persistence server lib (fplugin)
1343 * Performance iprovements on the backend
0 3.0b4
0 3.0.1
4646 if not parsed_args.dry_run:
4747 models.create_host(workspace, obj_host)
4848 old_host = models.get_host(workspace, **params)
49 else:
50 return 0, None
4951 else:
5052 print "A host with ID %s already exists!" % old_host.getID()
5153 return 2, None
1717 parser.add_argument('name', help='Service Name')
1818 parser.add_argument('ports', help='Service ports, as a comma separated list')
1919 parser.add_argument('--protocol', help='Service protocol', default='tcp')
20 parser.add_argument('--status', help='Service status', default='running')
20 parser.add_argument('--status', help='Service status', default='open')
2121 parser.add_argument('--version', help='Service version', default='unknown')
2222 parser.add_argument('--description', help='Service description', default='')
2323
99 from time import mktime
1010 from datetime import datetime
1111 from persistence.server import models
12 from persistence.server.server_io_exceptions import ConflictInDatabase, CantCommunicateWithServerError
1213
1314 WORKSPACE = ""
1415 __description__ = "Import Faraday objects from CSV file"
9091 value[val] = register[key]
9192
9293 elif key == "vulnerability_severity" or key == "vulnerability_web_severity":
94 if register[key].lower() == 'informational':
95 register[key] = 'info'
96 if register[key].lower() == 'medium':
97 register[key] = 'med'
9398 if register[key].lower() in VULN_SEVERITIES:
9499 value[val] = register[key]
95100 else:
241246 counter = 0
242247 csv_reader = csv.DictReader(file_csv, delimiter=",", quotechar='"')
243248 for register in csv_reader:
244
245 host, service, vulnerability, vulnerability_web = parse_register(register)
246
247 # Set all IDs and create objects
248 if host is not None:
249 old_host = models.get_host(WORKSPACE, ip=host.getName())
250 if not old_host:
251
252 counter += 1
253 print "New host: " + host.getName()
254 models.create_host(WORKSPACE, host)
255 host = models.get_host(WORKSPACE, ip=host.getName())
256
257 if service is not None:
258 service.setParent(host.getID())
259 service_params = {
260 'name': service.getName(),
261 'port': service.getPorts()[0],
262 'protocol': service.getProtocol(),
263 'host_id': service.getParent()
264 }
265 old_service = models.get_service(WORKSPACE, **service_params)
266 if not old_service:
267
268 counter += 1
269 print "New service: " + service.getName()
270 models.create_service(WORKSPACE, service)
271 service = models.get_service(WORKSPACE, **service_params)
272
273 # Check if Service exist, then create the vuln with parent Service.
274 # If not exist the Service, create the vuln with parent Host.
275 if vulnerability is not None:
276 if host and not service:
277 parent_type = 'Host'
278 parent_id = host.getID()
279 if host and service:
280 parent_type = 'Service'
281 parent_id = service.getID()
282 vulnerability.setParent(parent_id)
283 vulnerability.setParentType(parent_type)
284
285 vuln_params = {
286 'name': vulnerability.getName(),
287 'description': vulnerability.getDescription(),
288 'parent_type': parent_type,
289 'parent': parent_id,
290 }
291 if not models.get_vuln(WORKSPACE, **vuln_params):
292
249 try:
250 host, service, vulnerability, vulnerability_web = parse_register(register)
251
252 # Set all IDs and create objects
253 if host is not None:
254 old_host = models.get_host(WORKSPACE, ip=host.getName())
255 if not old_host:
256
257 counter += 1
258
259 print "New host: " + host.getName()
260 try:
261 models.create_host(WORKSPACE, host)
262 except Exception as ex:
263 import ipdb; ipdb.set_trace()
264 host = models.get_host(WORKSPACE, ip=host.getName())
265
266 if service is not None:
267 service.setParent(host.getID())
268 service_params = {
269 'name': service.getName(),
270 'port': service.getPorts()[0],
271 'protocol': service.getProtocol(),
272 'host_id': service.getParent()
273 }
274 old_service = models.get_service(WORKSPACE, **service_params)
275 if not old_service:
276
277 counter += 1
278 print "New service: " + service.getName()
279 models.create_service(WORKSPACE, service)
280 service = models.get_service(WORKSPACE, **service_params)
281
282 # Check if Service exist, then create the vuln with parent Service.
283 # If not exist the Service, create the vuln with parent Host.
284 if vulnerability is not None:
285 if host and not service:
286 parent_type = 'Host'
287 parent_id = host.getID()
288 if host and service:
289 parent_type = 'Service'
290 parent_id = service.getID()
291 vulnerability.setParent(parent_id)
292 vulnerability.setParentType(parent_type)
293
294 vuln_params = {
295 'name': vulnerability.getName(),
296 'description': vulnerability.getDescription(),
297 'parent_type': parent_type,
298 'parent': parent_id,
299 }
293300 counter += 1
294301 print "New vulnerability: " + vulnerability.getName()
295302 models.create_vuln(WORKSPACE, vulnerability)
296303
297 elif vulnerability_web is not None:
298
299 vuln_web_params = {
300 'name': vulnerability_web.getName(),
301 'description': vulnerability_web.getDescription(),
302 'parent': service.getID(),
303 'parent_type': 'Service',
304 'method': vulnerability_web.getMethod(),
305 'parameter_name': vulnerability_web.getParams(),
306 'path': vulnerability_web.getPath(),
307 'website': vulnerability_web.getWebsite(),
308 }
309 vulnerability_web.setParent(service.getID())
310 if not models.get_web_vuln(WORKSPACE, **vuln_web_params):
311
312 counter += 1
313 print "New web vulnerability: " + vulnerability_web.getName()
314 models.create_vuln_web(WORKSPACE, vulnerability_web)
315
304 elif vulnerability_web is not None:
305
306 vuln_web_params = {
307 'name': vulnerability_web.getName(),
308 'description': vulnerability_web.getDescription(),
309 'parent': service.getID(),
310 'parent_type': 'Service',
311 'method': vulnerability_web.getMethod(),
312 'parameter_name': vulnerability_web.getParams(),
313 'path': vulnerability_web.getPath(),
314 'website': vulnerability_web.getWebsite(),
315 }
316 vulnerability_web.setParent(service.getID())
317 if not models.get_web_vuln(WORKSPACE, **vuln_web_params):
318
319 counter += 1
320 print "New web vulnerability: " + vulnerability_web.getName()
321 models.create_vuln_web(WORKSPACE, vulnerability_web)
322 except ConflictInDatabase:
323 print('Conflict in Database, skiping csv row')
324 except CantCommunicateWithServerError as ex:
325 print(register)
326 print('Error', ex)
316327 print "[*]", counter, "new Faraday objects created."
317328 file_csv.close()
318329 return 0, None
+0
-2849
data/cwe_all.csv less more
0 cwe,name,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.
2 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.
3 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
4 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
5 Safe C String Library v1.0.3: http://www.zork.org/safestr/
6 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
7 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
8 PaX: http://en.wikipedia.org/wiki/PaX
9 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
10 The Art of Software Security Assessment: Chapter 5, ""Memory Corruption"", Page 167.
11 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
12 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.
13 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"
14 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.
15 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
16 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/
17 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
18 PaX: http://en.wikipedia.org/wiki/PaX
19 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
20 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
21 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
22 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.
23 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
24 Integral Security: http://www.ddj.com/security/193501774"
25 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.
26 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
27 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
28 Hacking Exposed Web Applications, Second Edition: Input Validation Attacks
29 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
30 The importance of input validation: http://searchsoftwarequality.techtarget.com/tip/0,289483,sid92_gci1214373,00.html
31 Writing Secure Code: Chapter 10, ""All Input Is Evil!"" Page 341"
32 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.
33 The information either
34 is regarded as sensitive within the product's own functionality, such as a private message; or
35 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.
36 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/
37 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.
38 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
39 Secure Programming with Static Analysis: Section 9.2, page 326.
40 Writing Secure Code: Chapter 16, ""General Good Practices."" Page 415
41 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
42 24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
43 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
44 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
45 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.
46 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,high,
47 CWE-242,EN-Use of Inherently Dangerous Function (Type: Base),"The program calls a function that can never be guaranteed to work safely.
48 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
49 Writing Secure Code: Chapter 5, ""gets and fgets"" Page 163"
50 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.
51 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,
52 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.
53 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
54 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.
55 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
56 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
57 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.
58 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.
59 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/
60 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
61 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/
62 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
63 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
64 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39.
65 The Art of Software Security Assessment: Chapter 11, ""ACL Inheritance"", Page 649."
66 CWE-291,EN-Reliance on IP Address for Authentication (Type: Variant),"The software uses an IP address for authentication.
67 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,
68 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.
69 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,
70 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.
71 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."
72 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).
73 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,
74 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.
75 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.
76 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
77 Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
78 Secure programming with the OpenSSL API, Part 2: Secure handshake: http://www.ibm.com/developerworks/library/l-openssl2/index.html
79 An Introduction to OpenSSL Programming (Part I): http://www.rtfm.com/openssl-examples/part1.pdf
80 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
81 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.
82 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,
83 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.
84 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
85 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,
86 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.
87 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
88 The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
89 CWE-323,"EN-Reusing a Nonce, Key Pair in Encryption (Type: Base)","Nonces should be used for the present occasion and only once.
90 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,
91 CWE-360,EN-Trust of System Event Data (Type: Base),"Security based on event locations are insecure and can be spoofed.
92 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,
93 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.
94 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,
95 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.
96 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:
97 Error conditions and other exceptional circumstances.
98 Confusion over which part of the program is responsible for freeing the memory.
99 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.
100 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"
101 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.
102 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
103 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
104 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
105 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
106 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.
107 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
108 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.
109 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,
110 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.
111 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,
112 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.
113 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,
114 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.
115 Public static variables can be read without an accessor and changed without a mutator by any classes in the application.",,high,
116 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.
117 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,
118 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.
119 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,
120 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.
121 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.
122 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"
123 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.
124 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.
125 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
126 HMAC: http://en.wikipedia.org/wiki/Hmac
127 24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75"
128 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.
129 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
130 The Art of Software Security Assessment: Chapter 17, ""XPath Injection"", Page 1070."
131 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.
132 An attacker may be able to conduct cross-site scripting and other attacks against users who have these components enabled.
133 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,
134 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.
135 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,
136 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.
137 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,
138 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.
139 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:
140 http://WWW.EXAMPLE.COM/mypage
141 http://www.example.com/%6Dypage (alternate encoding)
142 http://192.168.1.1/mypage (IP address)
143 http://www.example.com/mypage/ (trailing /)
144 http://www.example.com:80/mypage
145 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,
146 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.
147 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,
148 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.
149 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,
150 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.
151 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,
152 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.
153 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
154 Writing Secure Code: Chapter 5, ""Safe String Handling"" Page 156, 160
155 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
156 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..
157 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/
158 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
159 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
160 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..
161 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.
162 There are at least two subtypes of OS command injection:
163 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.
164 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.
165 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
166 Meta-Character Vulnerabilities: http://www.cs.purdue.edu/homes/cs390s/slides/week09.pdf
167 OS Commanding: http://projects.webappsec.org/OS-Commanding
168 The World Wide Web Security FAQ: http://www.w3.org/Security/Faq/wwwsf4.html
169 Security Issues in Perl Scripts: http://www.cgisecurity.com/lib/sips.html
170 24 Deadly Sins of Software Security: ""Sin 10: Command Injection."" Page 171
171 Top 25 Series - Rank 9 - OS Command Injection: http://blogs.sans.org/appsecstreetfighter/2010/02/24/top-25-series-rank-9-os-command-injection/
172 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
173 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
174 The Art of Software Security Assessment: Chapter 8, ""Shell Metacharacters"", Page 425."
175 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.
176 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
177 Writing Secure Code: Chapter 13, ""Sensitive Data in Cookies and Fields"" Page 435"
178 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.
179 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.
180 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/
181 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
182 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/
183 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
184 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
185 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
186 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.
187 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.
188 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/
189 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
190 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/
191 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
192 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
193 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
194 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.
195 This may enable an attacker to access or modify otherwise protected system resources.",,high,
196 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.
197 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,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127
198 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
199 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
200 Safe C String Library v1.0.3: http://www.zork.org/safestr/
201 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
202 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
203 PaX: http://en.wikipedia.org/wiki/PaX
204 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/
205 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
206 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
207 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
208 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189.
209 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
210 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().
211 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,"Writing Secure Code: Chapter 5, ""Heap Overruns"" Page 138
212 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
213 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
214 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
215 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.
216 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,"SafeInt: http://safeint.codeplex.com/
217 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
218 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
219 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
220 PaX: http://en.wikipedia.org/wiki/PaX
221 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
222 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
223 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
224 The Art of Software Security Assessment: Chapter 8, ""Incrementing Pointers Incorrectly"", Page 401."
225 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.
226 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.
227 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,"Writing Secure Code: Chapter 11, ""Directory Traversal and Using Parent Paths (..)"" Page 370
228 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
229 Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
230 Top 25 Series - Rank 7 - Path Traversal: http://blogs.sans.org/appsecstreetfighter/2010/03/09/top-25-series-rank-7-path-traversal/
231 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
232 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
233 CWE-311,EN-Missing Encryption of Sensitive Data (Type: Base),"The software does not encrypt sensitive or critical information before storage or transmission.
234 The lack of proper data encryption passes up the guarantees of confidentiality, integrity, and accountability that properly implemented encryption conveys.",,high,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
235 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253
236 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/
237 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
238 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf"
239 CWE-464,EN-Addition of Data Structure Sentinel (Type: Base),"The accidental addition of a data-structure sentinel can cause serious programming logic problems.
240 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,
241 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.
242 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,"Writing Secure Code
243 The Art of Software Security Assessment: Chapter 11, ""Device Files"", Page 666."
244 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.
245 This could allow an attacker to access or modify system files or other files that are critical to the application.
246 Path manipulation errors occur when the following two conditions are met:
247 1. An attacker can specify a path used in an operation on the filesystem.
248 2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted.
249 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,OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
250 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.
251 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,
252 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.
253 Cross-site scripting (XSS) vulnerabilities occur when:
254 1. Untrusted data enters a web application, typically from a web request.
255 2. The web application dynamically generates a web page that contains this untrusted data.
256 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.
257 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
258 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.
259 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.
260 There are three main kinds of XSS:
261 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.
262 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.
263 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.
264 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.""
265 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,"XSS Attacks
266 24 Deadly Sins of Software Security: ""Sin 2: Web-Server Related Vulnerabilities (XSS, XSRF, and Response Splitting)."" Page 31
267 24 Deadly Sins of Software Security: ""Sin 3: Web-Client Related Vulnerabilities (XSS)."" Page 63
268 Cross-site scripting: http://en.wikipedia.org/wiki/Cross-site_scripting
269 Writing Secure Code: Chapter 13, ""Web-Specific Input Issues"" Page 413
270 XSS (Cross Site Scripting) Cheat Sheet: http://ha.ckers.org/xss.html
271 Mitigating Cross-site Scripting With HTTP-only Cookies: http://msdn.microsoft.com/en-us/library/ms533046.aspx
272 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
273 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
274 XSS Defense HOWTO: http://blog.modsecurity.org/2008/07/do-you-know-how.html
275 Web Application Firewall: http://www.owasp.org/index.php/Web_Application_Firewall
276 Web Application Firewall Evaluation Criteria: http://www.webappsec.org/projects/wafec/v1/wasc-wafec-v1.0.html
277 Firefox Implements httpOnly And is Vulnerable to XMLHTTPRequest
278 XMLHttpRequest allows reading HTTPOnly cookies: https://bugzilla.mozilla.org/show_bug.cgi?id=380418
279 Apache Wicket: http://wicket.apache.org/
280 XSS (Cross Site Scripting) Prevention Cheat Sheet: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet
281 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
282 Top 25 series - Rank 1 - Cross Site Scripting: http://blogs.sans.org/appsecstreetfighter/2010/02/22/top-25-series-rank-1-cross-site-scripting/
283 The Art of Software Security Assessment: Chapter 17, ""Cross Site Scripting"", Page 1071."
284 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.
285 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,
286 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.
287 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,"Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
288 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
289 A Study in Scarlet: http://www.cgisecurity.com/lib/studyinscarlet.txt
290 Suhosin: http://www.hardened-php.net/suhosin/
291 Top 25 Series - Rank 13 - PHP File Inclusion: http://blogs.sans.org/appsecstreetfighter/2010/03/11/top-25-series-rank-13-php-file-inclusion/"
292 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.
293 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."
294 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.
295 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."
296 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.
297 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.
298 Writing Secure Code: Chapter 20, ""Checking Returns"" Page 624
299 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
300 ERR10-CPP. Check for error conditions: https://www.securecoding.cert.org/confluence/display/cplusplus/ERR10-CPP.+Check+for+error+conditions"
301 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.
302 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."
303 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.
304 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.
305 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.
306 There are several ways in which the chain of trust might be broken, including but not limited to:
307 Any certificate in the chain is self-signed, unless it the root.
308 Not every intermediate certificate is checked, starting from the original certificate all the way up to the root certificate.
309 An intermediate, CA-signed certificate does not have the expected Basic Constraints or other important extensions.
310 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
311 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
312 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.
313 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"
314 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.
315 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"
316 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.
317 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."
318 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.
319 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,
320 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.
321 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.
322 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."
323 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.
324 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.
325 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."
326 CWE-481,EN-Assigning instead of Comparing (Type: Variant),"The code uses an operator for assignment when the intention was to perform a comparison.
327 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."
328 CWE-482,EN-Comparing instead of Assigning (Type: Variant),"The code uses an operator for comparison when the intention was to perform an assignment.
329 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."
330 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.
331 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,
332 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.
333 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,
334 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.
335 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:
336 ensure that assumptions made by the APIs are valid, such as validity of arguments
337 account for known weaknesses in the design/implementation of the API
338 call the API from a safe context
339 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.
340 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,
341 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.
342 This weakness can be generally described as mismatching memory management routines, such as:
343 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.
344 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.
345 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
346 Valgrind: http://valgrind.org/"
347 CWE-783,EN-Operator Precedence Logic Error (Type: Variant),"The program uses an expression in which operator precedence causes incorrect logic to be used.
348 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
349 The Art of Software Security Assessment: Chapter 6, ""Precedence"", Page 287."
350 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.
351 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."
352 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.
353 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,
354 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.
355 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.",,medium,"Portably Solving File TOCTTOU Races with Hardness Amplification: http://www.usenix.org/events/fast08/tech/tsafrir.html
356 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
357 The Art of Software Security Assessment: Chapter 9, ""TOCTOU"", Page 527."
358 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.
359 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.",,medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
360 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.
361 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.",,medium,Algorithmic Complexity Attacks: http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003/index.html
362 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.
363 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.",,medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
364 The Art of Software Security Assessment: Chapter 7, ""Double Frees"", Page 379."
365 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.
366 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.",,medium,"The Art of Software Security Assessment: Chapter 9, ""Symbolic Link Attacks"", Page 518."
367 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.
368 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.",,medium,"Exploitable Redirects on the Web: Identification, Prevalence, and Defense: http://www.cs.indiana.edu/cgi-pub/cshue/research/woot08.pdf
369 Open redirect vulnerabilities: definition and prevention: http://www.net-security.org/dl/insecure/INSECURE-Mag-17.pdf
370 Top 25 Series - Rank 23 - Open Redirect: http://software-security.sans.org/blog/2010/03/25/top-25-series-rank-23-open-redirect
371 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
372 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.
373 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.
374 The exposure can occur in a few different ways:
375 1) The function/method was never intended to be exposed to outside actors.
376 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.",,medium,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
377 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp"
378 CWE-755,EN-Improper Handling of Exceptional Conditions (Type: Class),"The software does not handle or incorrectly handles an exceptional condition.
379 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.
380 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,
381 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.
382 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.",,medium,
383 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.
384 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.",,medium,
385 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.
386 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.",,medium,"Multiple vendors XML parser (and SOAP/WebServices server) Denial of Service attack using DTD: http://www.securityfocus.com/archive/1/303509
387 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#
388 Dismantling an XML-Bomb: http://blog.didierstevens.com/2008/09/23/dismantling-an-xml-bomb/
389 XML Entity Expansion: http://projects.webappsec.org/XML-Entity-Expansion
390 Tip: Configure SAX parsers for secure processing: http://www.ibm.com/developerworks/xml/library/x-tipcfsx.html
391 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
392 Preventing Entity Expansion Attacks in JAXB: http://blog.bdoughan.com/2011/03/preventing-entity-expansion-attacks-in.html"
393 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.
394 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.",,medium,
395 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.
396 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.",,medium,
397 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.
398 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.",,medium,"Exploiting Common Flaws in Drivers: http://reversemode.com/index.php?option=com_content&task=view&id=38&Itemid=1
399 Remote and Local Exploitation of Network Drivers: https://www.blackhat.com/presentations/bh-usa-07/Bulygin/Presentation/bh-usa-07-bulygin.pdf
400 Windows driver vulnerabilities: the METHOD_NEITHER odyssey: http://www.net-security.org/dl/insecure/INSECURE-Mag-18.pdf
401 Buffer Descriptions for I/O Control Codes: http://msdn.microsoft.com/en-us/library/ms795857.aspx
402 Using Neither Buffered Nor Direct I/O: http://msdn.microsoft.com/en-us/library/cc264614.aspx
403 Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
404 No description: http://www.piotrbania.com/all/articles/ewdd.pdf"
405 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.
406 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.
407 The implementations of IOCTLs will differ between operating system types and versions, so the methods of attack and prevention may vary widely.",,medium,Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
408 CWE-117,EN-Improper Output Neutralization for Logs (Type: Base),"The software does not neutralize or incorrectly neutralizes output that is written to logs.
409 This can allow an attacker to forge log entries or inject malicious content into logs.
410 Log forging vulnerabilities occur when:
411 Data enters an application from an untrusted source.
412 The data is written to an application or system log file.",,medium,"Exploiting Software: How to Break Code
413 The night the log was forged: http://doc.novsu.ac.ru/oreilly/tcpip/puis/ch10_05.htm
414 OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007"
415 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.
416 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
417 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
418 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.
419 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
420 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
421 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.
422 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,
423 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.
424 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
425 Basic Integer Overflows: http://www.phrack.org/issues.html?issue=60&id=10#article
426 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
427 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
428 SafeInt: http://safeint.codeplex.com/
429 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
430 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
431 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.
432 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."
433 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.
434 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,
435 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.
436 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.
437 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/
438 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
439 Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
440 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm
441 24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
442 The Art of Software Security Assessment: Chapter 9, ""Privilege Vulnerabilities"", Page 477."
443 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.
444 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
445 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
446 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.
447 If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,medium,
448 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.
449 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."
450 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.
451 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"
452 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.
453 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."
454 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.
455 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."
456 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.
457 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
458 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.
459 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"
460 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.
461 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"
462 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.
463 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,
464 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.
465 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.
466 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.
467 A race condition violates these properties, which are closely related:
468 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.
469 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.
470 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).
471 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
472 volatile - Multithreaded Programmer's Best Friend: http://www.ddj.com/cpp/184403766
473 Thread-safe webapps using Spring: http://www.javalobby.org/articles/thread-safe/index.jsp
474 Prevent race conditions: http://www.ibm.com/developerworks/library/l-sprace.html
475 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
476 Secure Programming for Linux and Unix HOWTO: http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/avoid-race.html
477 Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
478 On Race Vulnerabilities in Web Applications: http://security.dico.unimi.it/~roberto/pubs/dimva08-web.pdf
479 Avoiding Race Conditions and Insecure File Operations: http://developer.apple.com/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html
480 Top 25 Series - Rank 25 - Race Conditions: http://blogs.sans.org/appsecstreetfighter/2010/03/26/top-25-series-rank-25-race-conditions/
481 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
482 CWE-364,EN-Signal Handler Race Condition (Type: Base),"The software uses a signal handler that introduces a race condition.
483 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.
484 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.
485 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
486 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
487 Shared state between a signal handler and other signal handlers
488 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.
489 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.
490 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
491 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.
492 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:
493 Avoiding shared state
494 Using synchronization in the signal handler
495 Using synchronization in the regular code
496 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
497 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html
498 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
499 The Art of Software Security Assessment: Chapter 13, ""Signal Vulnerabilities"", Page 791."
500 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.
501 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.
502 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.
503 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
504 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
505 Shared state between a signal handler and other signal handlers
506 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.
507 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.
508 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
509 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.
510 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:
511 Avoiding shared state
512 Using synchronization in the signal handler
513 Using synchronization in the regular code
514 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"
515 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.
516 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.
517 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.
518 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
519 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
520 Shared state between a signal handler and other signal handlers
521 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.
522 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.
523 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
524 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.
525 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:
526 Avoiding shared state
527 Using synchronization in the signal handler
528 Using synchronization in the regular code
529 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
530 The Art of Software Security Assessment: Chapter 13, ""Race Conditions"", Page 759."
531 CWE-369,EN-Divide By Zero (Type: Base),"The product divides a value by zero.
532 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
533 No description: http://msdn.microsoft.com/en-us/library/ms173160(VS.80).aspx"
534 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.
535 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"
536 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.
537 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
538 Java: The Complete Reference, J2SE 5th Edition"
539 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.
540 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,
541 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.
542 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.
543 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,
544 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.
545 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.
546 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"
547 CWE-391,EN-Unchecked Error Condition (Type: Base),"Ignoring exceptions and other error conditions may allow an attacker to induce unexpected behavior unnoticed.
548 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.
549 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,
550 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.
551 This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.",,medium,How to Break Software Security
552 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.
553 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,
554 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.
555 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."
556 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.
557 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,
558 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.
559 NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,medium,
560 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.
561 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."
562 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.
563 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,
564 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.
565 Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
566 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,
567 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.
568 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
569 Authenticode: http://msdn.microsoft.com/en-us/library/ms537359(v=VS.85).aspx
570 Code Signing Guide: http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Introduction/chapter_1_section_1.html
571 Secure Software Updates: Disappointments and New Challenges: http://prisms.cs.umass.edu/~kevinfu/papers/secureupdates-hotsec06.pdf
572 24 Deadly Sins of Software Security: ""Sin 18: The Sins of Mobile Code."" Page 267
573 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/
574 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
575 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.
576 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,
577 CWE-502,EN-Deserialization of Untrusted Data (Type: Variant),"The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
578 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.
579 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
580 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
581 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.
582 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,
583 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.
584 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"
585 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.
586 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
587 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
588 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
589 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.
590 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.
591 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
592 The Art of Software Security Assessment: Chapter 1, ""Exceptional Conditions,"" Page 22
593 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
594 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/"
595 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.
596 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."
597 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.
598 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
599 Optimal Asymmetric Encryption Padding: http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding"
600 CWE-908,EN-Use of Uninitialized Resource (Type: Base),"The software uses a resource that has not been properly initialized.
601 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
602 CWE-909,EN-Missing Initialization of Resource (Type: Base),"The software does not initialize a critical resource.
603 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,
604 CWE-910,EN-Use of Expired File Descriptor (Type: Base),"The software uses or accesses a file descriptor after it has been closed.
605 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,
606 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.
607 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
608 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.
609 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.
610 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"
611 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"").
612 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
613 The Art of Software Security Assessment: Chapter 18, ""Inline Evaluation"", Page 1095."
614 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.
615 Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.",,high,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
616 Top 10 2007-Broken Authentication and Session Management: http://www.owasp.org/index.php/Top_10_2007-A7
617 Guide to Authentication: http://www.owasp.org/index.php/Guide_to_Authentication
618 Authentication: http://msdn.microsoft.com/en-us/library/aa374735(VS.85).aspx
619 Writing Secure Code: Chapter 4, ""Authentication"" Page 109"
620 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.
621 Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,high,"The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authentication,"" Page 36
622 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/
623 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
624 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.
625 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.",,high,"Top 10 2007-Insecure Communications: http://www.owasp.org/index.php/Top_10_2007-A9
626 Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
627 24 Deadly Sins of Software Security: ""Sin 22: Failing to Protect Network Traffic."" Page 337
628 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
629 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.
630 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.",,high,"Applied Cryptography: http://www.schneier.com/book-applied.html
631 Handbook of Applied Cryptography: http://www.cacr.math.uwaterloo.ca/hac/
632 Avoiding bogus encryption products: Snake Oil FAQ: http://www.faqs.org/faqs/cryptography-faq/snake-oil/
633 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
634 Microsoft Scraps Old Encryption in New Code: http://www.eweek.com/c/a/Security/Microsoft-Scraps-Old-Encryption-in-New-Code/
635 Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
636 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315
637 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/
638 The Art of Software Security Assessment: Chapter 2, ""Insufficient or Obsolete Encryption"", Page 44."
639 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.
640 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.",,high,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
641 Building Secure Software: How to Avoid Security Problems the Right Way
642 Writing Secure Code: Chapter 8, ""Using Poor Random Numbers"" Page 259
643 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
644 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.
645 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.
646 Resource exhaustion problems have at least two common causes:
647 Error conditions and other exceptional circumstances
648 Confusion over which part of the program is responsible for releasing the resource",,high,"Detection and Prediction of Resource-Exhaustion Vulnerabilities: http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf
649 Resource exhaustion: http://cr.yp.to/docs/resources.html
650 Resource exhaustion: http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt
651 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
652 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.
653 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.",,high,"Dynamic File Uploads, Security and You: http://shsc.info/FileUploadSecurity
654 8 Basic Rules to Implement Secure File Uploads: http://blogs.sans.org/appsecstreetfighter/2009/12/28/8-basic-rules-to-implement-secure-file-uploads/
655 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/
656 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
657 The Art of Software Security Assessment: Chapter 17, ""File Uploading"", Page 1068."
658 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.
659 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.",,high,
660 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.
661 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,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
662 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.
663 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.",,high,"The Art of Software Security Assessment: Chapter 9, ""File Permissions."" Page 495.
664 Building Secure Software: How to Avoid Security Problems the Right Way: Chapter 8, ""Access Control."" Page 194.
665 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
666 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm"
667 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.
668 Command injection vulnerabilities typically occur when:
669 1. Data enters the application from an untrusted source.
670 2. The data is part of a string that is executed as a command by the application.
671 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,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
672 Detection and Prediction of Resource-Exhaustion Vulnerabilities: http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf
673 Resource exhaustion: http://cr.yp.to/docs/resources.html
674 Resource exhaustion: http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt
675 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517
676 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/
677 The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
678 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.
679 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.",,high,
680 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.
681 When a resource is not released after use, it can allow attackers to cause a denial of service.",,high,
682 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.
683 This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,high,
684 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.
685 This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,high,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
686 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.
687 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.",,high,"The Art of Software Security Assessment: Chapter 10, ""File Descriptor Leaks"", Page 582."
688 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.
689 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.
690 There can be several different causes of a guessable CAPTCHA:
691 An audio or visual image that does not have sufficient distortion from the unobfuscated source image.
692 A question is generated that with a format that can be automatically recognized, such as a math question.
693 A question for which the number of possible answers is limited, such as birth years or favorite sports teams.
694 A general-knowledge or trivia question for which the answer can be accessed using a data base, such as country capitals or popular actors.
695 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.",,high,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
696 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.
697 When the length value exceeds the size of the destination, a buffer overflow could occur.",,high,"Writing Secure Code: Chapter 6, ""Why ACLs Are Important"" Page 171
698 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
699 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
700 PaX: http://en.wikipedia.org/wiki/PaX
701 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/
702 Safe C String Library v1.0.3: http://www.zork.org/safestr/
703 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
704 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
705 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
706 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.
707 When the size of the destination is smaller than the size of the source, a buffer overflow could occur.",,high,"Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
708 Safe C String Library v1.0.3: http://www.zork.org/safestr/
709 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
710 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
711 PaX: http://en.wikipedia.org/wiki/PaX
712 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"
713 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.
714 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.
715 Without sufficient encryption, integrity checking, or other mechanism, any input that originates from an outsider cannot be trusted.",,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/
716 HMAC: http://en.wikipedia.org/wiki/Hmac
717 Understanding ASP.NET View State: http://msdn.microsoft.com/en-us/library/ms972976.aspx
718 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
719 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.
720 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.",,high,CRLF Injection: http://marc.info/?l=bugtraq&m=102088154213630&w=2
721 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.
722 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.",,unclassified,
723 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().
724 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.",,unclassified,
725 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.
726 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.",,unclassified,
727 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.
728 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.",,unclassified,
729 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.
730 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.",,unclassified,
731 CWE-107,EN-Struts: Unused Validation Form (Type: Variant),"An unused validation form indicates that validation logic is not up-to-date.
732 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.",,unclassified,
733 CWE-108,EN-Struts: Unvalidated Action Form (Type: Variant),"Every Action Form must have a corresponding validation form.
734 If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,unclassified,
735 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.
736 If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,unclassified,
737 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.
738 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.",,unclassified,
739 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.
740 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.",,unclassified,
741 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.
742 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.",,unclassified,"Fortify Descriptions: http://vulncat.fortifysoftware.com
743 The Java(TM) Tutorial: The Java Native Interface: http://java.sun.com/docs/books/tutorial/native1.1/"
744 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.
745 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.",,unclassified,
746 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.
747 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.
748 HTTP response splitting weaknesses may be present when:
749 Data enters a web application through an untrusted source, most frequently an HTTP request.
750 The data is included in an HTTP response header sent to a web user without being validated for malicious characters.",,unclassified,"OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007
751 24 Deadly Sins of Software Security: ""Sin 2: Web-Server Related Vulnerabilities (XSS, XSRF, and Response Splitting)."" Page 31"
752 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.
753 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.",,unclassified,
754 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.
755 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.",,unclassified,
756 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.
757 This can allow an attacker to forge log entries or inject malicious content into logs.
758 Log forging vulnerabilities occur when:
759 Data enters an application from an untrusted source.
760 The data is written to an application or system log file.",,unclassified,
761 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.
762 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.
763 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.",,unclassified,"19 Deadly Sins of Software Security
764 ASP.NET Misconfiguration: Missing Custom Error Handling: http://www.owasp.org/index.php/ASP.NET_Misconfiguration:_Missing_Custom_Error_Handling"
765 CWE-125,EN-Out-of-bounds Read (Type: Base),"The software reads data past the end, or before the beginning, of the intended buffer.
766 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
767 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.
768 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.",,unclassified,
769 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.
770 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.",,unclassified,
771 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.
772 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.",,unclassified,"How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI: http://msdn.microsoft.com/en-us/library/ms998280.aspx
773 How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA: http://msdn.microsoft.com/en-us/library/ms998283.aspx
774 .NET Framework Developer's Guide - Securing Connection Strings: http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx"
775 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.
776 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.",,unclassified,
777 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.
778 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.",,unclassified,
779 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.
780 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.",,unclassified,"Writing Secure Code: Chapter 5, ""Unicode and ANSI Buffer Size Mismatches"" Page 153"
781 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.
782 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"".",,unclassified,
783 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.""
784 This compiler optimization error occurs when:
785 1. Secret data are stored in memory.
786 2. The secret data are scrubbed from memory by overwriting its contents.
787 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.",,unclassified,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322
788 When scrubbing secrets in memory doesn't work: http://cert.uni-stuttgart.de/archive/bugtraq/2002/11/msg00046.html
789 Some Bad News and Some Good News: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncode/html/secure10102002.asp
790 GNU GCC: Optimizer Removes Code Necessary for Security: http://www.derkeiler.com/Mailing-Lists/securityfocus/bugtraq/2002-11/0257.html"
791 CWE-140,EN-Improper Neutralization of Delimiters (Type: Base),"The software does not neutralize or incorrectly neutralizes delimiters.
792 This compiler optimization error occurs when:
793 1. Secret data are stored in memory.
794 2. The secret data are scrubbed from memory by overwriting its contents.
795 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.",,unclassified,
796 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.
797 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408.
798 The Art of Software Security Assessment: Chapter 10, ""IFS"", Page 604."
799 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.
800 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
801 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.
802 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
803 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.
804 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
805 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.
806 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.
807 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.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
808 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.
809 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
810 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.
811 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.",,unclassified,
812 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.
813 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.",,unclassified,
814 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.
815 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.",,unclassified,
816 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.
817 Allowing external control of system settings can disrupt service or cause an application to behave in unexpected, and potentially malicious ways.",,unclassified,
818 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.
819 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,
820 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.
821 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,
822 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.
823 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,
824 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.
825 As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,unclassified,
826 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.
827 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.",,unclassified,
828 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.
829 As data is parsed, an injected element may cause the process to take unexpected actions.",,unclassified,
830 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.
831 This can include space, tab, etc.",,unclassified,
832 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.
833 This can include space, tab, etc.",,unclassified,
834 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.
835 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.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""NUL Character Injection"", Page 411."
836 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.
837 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.",,unclassified,
838 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.
839 As data is parsed, improperly handled leading special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
840 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.
841 As data is parsed, improperly handled multiple leading special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
842 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.
843 As data is parsed, improperly handled trailing special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
844 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.
845 As data is parsed, improperly handled multiple trailing special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
846 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.
847 As data is parsed, improperly handled internal special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
848 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.
849 As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
850 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.
851 As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
852 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.
853 As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,unclassified,
854 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.
855 An example of this problem would be if paired characters appear in the wrong order, or if the special characters are not properly nested.",,unclassified,
856 CWE-172,EN-Encoding Error (Type: Class),"The software does not properly encode or decode the data, resulting in unexpected values.
857 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.",,unclassified,
858 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.
859 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.",,unclassified,
860 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.
861 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.",,unclassified,
862 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.
863 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.",,unclassified,
864 CWE-176,EN-Improper Handling of Unicode Encoding (Type: Variant),"The software does not properly handle when an input contains Unicode encoding.
865 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.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Character Sets and Unicode"", Page 446."
866 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.
867 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.",,unclassified,
868 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.
869 Improperly handled case sensitive data can lead to several possible consequences, including:
870 case-insensitive passwords reducing the size of the key space, making brute force attacks easier
871 bypassing filters or access controls using alternate names
872 multiple interpretation errors using alternate names.",,unclassified,
873 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.
874 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.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Escaping Metacharacters"", Page 439."
875 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.
876 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.",,unclassified,
877 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.
878 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.",,unclassified,
879 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.
880 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.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
881 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.
882 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.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
883 CWE-184,EN-Incomplete Blacklist (Type: Base),"An application uses a ""blacklist"" of prohibited values, but the blacklist is incomplete.
884 If an incomplete blacklist is used as a security mechanism, then the software may allow unintended values to pass into the application logic.",,unclassified,"Exploiting Software: How to Break Code
885 Blacklist defenses as a breeding ground for vulnerability variants: http://seclists.org/fulldisclosure/2006/Feb/0040.html
886 The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
887 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.
888 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.",,unclassified,"Writing Secure Code: Chapter 10, ""Using Regular Expressions for Checking Input"" Page 350"
889 CWE-186,EN-Overly Restrictive Regular Expression (Type: Base),"A regular expression is overly restrictive, which prevents dangerous values from being detected.
890 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.",,unclassified,
891 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.
892 For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,unclassified,
893 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.
894 This can happen in signed and unsigned cases.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119"
895 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.
896 This can happen in signed and unsigned cases.",,unclassified,"Third Generation Exploits: http://www.blackhat.com/presentations/bh-europe-01/halvar-flake/bh-europe-01-halvarflake.ppt
897 Off-by-one errors: a brief explanation: http://marc.theaimsgroup.com/?l=secprog&m=108379742110553&w=2
898 The Frame Pointer Overwrite: http://kaizo.org/mirrors/phrack/phrack55/P55-08
899 Exploiting Software: How to Break Code (The buffer overflow chapter)
900 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
901 The Art of Software Security Assessment: Chapter 5, ""Off-by-One Errors"", Page 180."
902 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.
903 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.",,unclassified,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
904 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.
905 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.",,unclassified,
906 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.
907 The information either
908 is regarded as sensitive within the product's own functionality, such as a private message; or
909 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.
910 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.",,unclassified,
911 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.
912 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.",,unclassified,
913 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.
914 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).",,unclassified,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
915 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.
916 For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,unclassified,
917 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.
918 For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,unclassified,
919 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.
920 For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,unclassified,
921 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.
922 For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,unclassified,
923 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.
924 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
925 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
926 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.
927 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.",,unclassified,
928 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.
929 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.
930 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.",,unclassified,
931 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.
932 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.
933 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.",,unclassified,
934 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.
935 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.",,unclassified,
936 CWE-215,EN-Information Exposure Through Debug Information (Type: Variant),"The application contains debugging code that can expose sensitive information to untrusted parties.
937 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.",,unclassified,
938 CWE-216,EN-Containment Errors (Container Errors) (Type: Class),"This tries to cover various problems in which improper data are included within a ""container.""
939 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.",,unclassified,
940 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.
941 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.",,unclassified,
942 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.
943 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.",,unclassified,
944 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.
945 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.",,unclassified,
946 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.
947 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.
948 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.",,unclassified,
949 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.
950 This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,unclassified,
951 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.
952 This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,unclassified,
953 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.
954 This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,unclassified,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
955 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.
956 This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,unclassified,Writing Secure Code
957 CWE-225,EN-DEPRECATED (Duplicate): General Information Management Problems (Type: Base),"This weakness can be found at CWE-199.
958 This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,unclassified,
959 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.
960 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.",,unclassified,
961 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.
962 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.",,unclassified,
963 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.
964 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.",,unclassified,
965 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.
966 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.",,unclassified,
967 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.
968 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,"OWASP Attack listing: http://www.owasp.org/index.php/Relative_Path_Traversal
969 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
970 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.
971 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
972 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.
973 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
974 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.
975 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
976 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.
977 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
978 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.
979 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
980 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.
981 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
982 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.
983 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
984 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.
985 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
986 CWE-239,EN-Failure to Handle Incomplete Element (Type: Variant),"The software does not properly handle when a particular element is not completely specified.
987 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,
988 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.
989 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
990 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 ""/"".",,unclassified,
991 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.
992 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
993 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 ""/"".",,unclassified,
994 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).
995 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
996 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 ""/"".",,unclassified,
997 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.
998 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.",,unclassified,
999 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.
1000 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.",,unclassified,
1001 CWE-246,EN-J2EE Bad Practices: Direct Use of Sockets (Type: Variant),"The J2EE application directly uses sockets instead of using framework method calls.
1002 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.",,unclassified,
1003 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.
1004 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.",,unclassified,
1005 CWE-248,EN-Uncaught Exception (Type: Base),"An exception is thrown from a function, but it is not caught.
1006 When an exception is not caught, it may cause the program to crash or expose sensitive information.",,unclassified,
1007 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.
1008 When an exception is not caught, it may cause the program to crash or expose sensitive information.",,unclassified,
1009 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.
1010 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1011 Sometimes a program checks for ""../"" at the beginning of the input, so a ""/../"" can bypass that check.",,unclassified,
1012 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.
1013 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1014 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.",,unclassified,
1015 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.
1016 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.",,unclassified,Building Secure Software: How to Avoid Security Problems the Right Way
1017 CWE-261,EN-Weak Cryptography for Passwords (Type: Variant),"Obscuring a password with a trivial encoding does not protect the password.
1018 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.",,unclassified,"Building Secure Software: How to Avoid Security Problems the Right Way
1019 24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1020 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.
1021 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.",,unclassified,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
1022 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.
1023 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.",,unclassified,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
1024 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.
1025 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1026 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.",,unclassified,
1027 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.
1028 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1029 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.",,unclassified,"Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
1030 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
1031 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.
1032 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.",,unclassified,
1033 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.
1034 If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,unclassified,
1035 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.
1036 If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,unclassified,
1037 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.
1038 If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,unclassified,
1039 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.
1040 If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,unclassified,
1041 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.
1042 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1043 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.",,unclassified,
1044 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.
1045 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1046 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.",,unclassified,
1047 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.
1048 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1049 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.",,unclassified,
1050 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.
1051 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1052 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.",,unclassified,
1053 CWE-283,EN-Unverified Ownership (Type: Base),"The software does not properly verify that a critical resource is owned by the proper entity.
1054 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1055 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.",,unclassified,
1056 CWE-284,EN-Improper Access Control (Type: Class),"The software does not restrict or incorrectly restricts access to a resource from an unauthorized actor.
1057 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.
1058 There are two distinct behaviors that can introduce access control weaknesses:
1059 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.
1060 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.",,unclassified,"Writing Secure Code: Chapter 6, ""Determining Appropriate Access Control"" Page 171
1061 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253"
1062 CWE-286,EN-Incorrect User Management (Type: Class),"The software does not properly manage a user within its environment.
1063 Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.",,unclassified,
1064 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.
1065 Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.",,unclassified,
1066 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.
1067 Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.",,unclassified,
1068 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.
1069 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1070 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.",,unclassified,
1071 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.
1072 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1073 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.",,unclassified,"The Art of Software Security Assessment: Chapter 3, ""Spoofing and Identification"", Page 72."
1074 CWE-295,EN-Improper Certificate Validation (Type: Base),"The software does not validate, or incorrectly validates, a certificate.
1075 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.",,unclassified,"Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
1076 Computer Security: Art and Science"
1077 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.
1078 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1079 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.",,unclassified,
1080 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.
1081 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.",,unclassified,Computer Security: Art and Science
1082 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.
1083 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.",,unclassified,
1084 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.
1085 This incorrect implementation may allow authentication to be bypassed.",,unclassified,
1086 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.
1087 Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,unclassified,
1088 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.
1089 Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,unclassified,
1090 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.
1091 Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,unclassified,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
1092 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
1093 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.
1094 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1095 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1096 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.
1097 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.",,unclassified,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
1098 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
1099 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
1100 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.
1101 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.",,unclassified,
1102 CWE-314,EN-Cleartext Storage in the Registry (Type: Variant),"The application stores sensitive information in cleartext in the registry.
1103 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.",,unclassified,
1104 CWE-315,EN-Cleartext Storage of Sensitive Information in a Cookie (Type: Variant),"The application stores sensitive information in cleartext in a cookie.
1105 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.",,unclassified,
1106 CWE-316,EN-Cleartext Storage of Sensitive Information in Memory (Type: Variant),"The application stores sensitive information in cleartext in memory.
1107 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.
1108 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.",,unclassified,
1109 CWE-317,EN-Cleartext Storage of Sensitive Information in GUI (Type: Variant),"The application stores sensitive information in cleartext within the GUI.
1110 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.",,unclassified,
1111 CWE-318,EN-Cleartext Storage of Sensitive Information in Executable (Type: Variant),"The application stores sensitive information in cleartext in an executable.
1112 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.",,unclassified,
1113 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.
1114 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1115 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).",,unclassified,
1116 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.
1117 Cryptographic implementations should follow the algorithms that define them exactly, otherwise encryption can be weaker than expected.",,unclassified,
1118 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.
1119 A weak encryption scheme can be subjected to brute force attacks that have a reasonable chance of succeeding using current attack methods and resources.",,unclassified,"Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
1120 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315"
1121 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.
1122 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.",,unclassified,"MD5 considered harmful today: http://www.phreedom.org/research/rogue-ca/
1123 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Integrity"", Page 47.
1124 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1125 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1126 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1127 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1128 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1129 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1130 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1131 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.
1132 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1133 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).",,unclassified,
1134 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.
1135 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.",,unclassified,Building Secure Software: How to Avoid Security Problems the Right Way
1136 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.
1137 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.",,unclassified,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1138 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1139 CWE-335,EN-PRNG Seed Error (Type: Class),"A Pseudo-Random Number Generator (PRNG) uses seeds incorrectly.
1140 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1141 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.
1142 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.",,unclassified,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1143 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.
1144 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.",,unclassified,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1145 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1146 CWE-339,EN-Small Seed Space in PRNG (Type: Base),"A PRNG uses a relatively small space of seeds.
1147 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.",,unclassified,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1148 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.
1149 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1150 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.",,unclassified,
1151 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.
1152 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1153 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1154 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.
1155 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1156 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.",,unclassified,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1157 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1158 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.
1159 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1160 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.",,unclassified,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1161 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1162 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.
1163 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.",,unclassified,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1164 Strange Attractors and TCP/IP Sequence Number Analysis: http://www.bindview.com/Services/Razor/Papers/2001/tcpseq.cfm
1165 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
1166 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.
1167 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.",,unclassified,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1168 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.
1169 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
1170 CWE-346,EN-Origin Validation Error (Type: Base),"The software does not properly verify that the source of data or communication is valid.
1171 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.",,unclassified,
1172 CWE-347,EN-Improper Verification of Cryptographic Signature (Type: Base),"The software does not verify, or incorrectly verifies, the cryptographic signature for data.
1173 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.",,unclassified,
1174 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.
1175 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.",,unclassified,
1176 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.
1177 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.",,unclassified,
1178 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.
1179 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
1180 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.",,unclassified,
1181 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.
1182 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.
1183 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.
1184 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231
1185 24 Deadly Sins of Software Security: ""Sin 24: Trusting Network Name Resolution."" Page 361
1186 The Art of Software Security Assessment: Chapter 16, ""DNS Spoofing"", Page 1002."
1187 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.
1188 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.
1189 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.
1190 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.",,unclassified,
1191 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.
1192 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.",,unclassified,
1193 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.
1194 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.",,unclassified,
1195 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.
1196 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.",,unclassified,
1197 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.
1198 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.",,unclassified,"AOL man pleads guilty to selling 92m email addies: http://www.theregister.co.uk/2005/02/07/aol_email_theft/
1199 Safe Harbor Privacy Framework: http://www.export.gov/safeharbor/
1200 Financial Privacy: The Gramm-Leach Bliley Act (GLBA): http://www.ftc.gov/privacy/glbact/index.html
1201 Health Insurance Portability and Accountability Act (HIPAA): http://www.hhs.gov/ocr/hipaa/
1202 California SB-1386: http://info.sen.ca.gov/pub/01-02/bill/sen/sb_1351-1400/sb_1386_bill_20020926_chaptered.html
1203 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
1204 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
1205 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.
1206 This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.",,unclassified,"The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
1207 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.
1208 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.",,unclassified,"The Art of Software Security Assessment: Chapter 9, ""Race Conditions"", Page 526."
1209 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.
1210 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
1211 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.
1212 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.",,unclassified,
1213 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.
1214 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.",,unclassified,
1215 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).
1216 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.",,unclassified,
1217 CWE-377,EN-Insecure Temporary File (Type: Base),"Creating and using insecure temporary files can leave application and system data vulnerable to attack.
1218 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.",,unclassified,"Writing Secure Code: Chapter 23, ""Creating Temporary Files Securely"" Page 682
1219 The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538.
1220 The Art of Software Security Assessment: Chapter 11, ""File Squatting"", Page 662."
1221 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.
1222 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.",,unclassified,
1223 CWE-382,EN-J2EE Bad Practices: Use of System.exit() (Type: Variant),"A J2EE application uses System.exit(), which also shuts down its container.
1224 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.",,unclassified,
1225 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.
1226 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.",,unclassified,
1227 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.
1228 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.
1229 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.",,unclassified,
1230 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.
1231 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.
1232 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.",,unclassified,
1233 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.
1234 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.
1235 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.",,unclassified,
1236 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.
1237 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.",,unclassified,
1238 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.
1239 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.",,unclassified,
1240 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.
1241 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.",,unclassified,
1242 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.
1243 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 9: Catching Exceptions."" Page 157"
1244 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.
1245 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.",,unclassified,
1246 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.
1247 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.",,unclassified,
1248 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.
1249 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.",,unclassified,"The Art of Software Security Assessment: Chapter 11, ""Filelike Objects"", Page 664."
1250 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.
1251 This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.",,unclassified,
1252 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.
1253 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.",,unclassified,"File descriptors and setuid applications: https://blogs.oracle.com/paulr/entry/file_descriptors_and_setuid_applications
1254 Introduction to Secure Coding Guide: https://developer.apple.com/library/mac/#documentation/security/conceptual/SecureCodingGuide/Articles/AccessControl.html"
1255 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.
1256 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.",,unclassified,
1257 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.
1258 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.",,unclassified,
1259 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.
1260 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.",,unclassified,
1261 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.
1262 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.",,unclassified,
1263 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.
1264 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.",,unclassified,
1265 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.
1266 Frequently the consequence is a ""flood"" of connection or sessions.",,unclassified,"Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
1267 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.
1268 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.",,unclassified,
1269 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.
1270 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.",,unclassified,
1271 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.
1272 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.",,unclassified,
1273 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.
1274 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:
1275 Error conditions and other exceptional circumstances.
1276 Confusion over which part of the program is responsible for freeing the memory.
1277 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.
1278 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.",,unclassified,
1279 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.
1280 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:
1281 Error conditions and other exceptional circumstances.
1282 Confusion over which part of the program is responsible for freeing the memory.
1283 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.
1284 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.",,unclassified,
1285 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.
1286 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:
1287 Error conditions and other exceptional circumstances.
1288 Confusion over which part of the program is responsible for freeing the memory.
1289 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.
1290 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.",,unclassified,
1291 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.
1292 This creates a race condition that allows an attacker to access the channel before the authorized user does.",,unclassified,"Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
1293 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
1294 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.
1295 This creates a race condition that allows an attacker to access the channel before the authorized user does.",,unclassified,"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
1296 The Art of Software Security Assessment: Chapter 2, ""Design Review."" Page 34.
1297 The Art of Software Security Assessment: Chapter 12, ""Shatter Attacks"", Page 694."
1298 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.
1299 This creates a race condition that allows an attacker to access the channel before the authorized user does.",,unclassified,
1300 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.
1301 This creates a race condition that allows an attacker to access the channel before the authorized user does.",,unclassified,
1302 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.
1303 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.",,unclassified,
1304 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.
1305 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.
1306 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:
1307 the directory from which the program has been loaded
1308 the current working directory.
1309 In some cases, the attack can be conducted remotely, such as when SMB or WebDAV network shares are used.
1310 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.",,unclassified,"Double clicking on MS Office documents from Windows Explorer may execute arbitrary programs in some cases
1311 ACROS Security: Remote Binary Planting in Apple iTunes for Windows (ASPR #2010-08-18-1)
1312 Automatic Detection of Vulnerable Dynamic Component Loadings: http://www.cs.ucdavis.edu/research/tech-reports/2010/CSE-2010-2.pdf
1313 Dynamic-Link Library Search Order: http://msdn.microsoft.com/en-us/library/ms682586%28v=VS.85%29.aspx
1314 Dynamic-Link Library Security: http://msdn.microsoft.com/en-us/library/ff919712%28VS.85%29.aspx
1315 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
1316 Insecure Library Loading Could Allow Remote Code Execution: http://www.microsoft.com/technet/security/advisory/2269637.mspx
1317 Application DLL Load Hijacking: http://blog.rapid7.com/?p=5325
1318 DLL Hijacking: Facts and Fiction: http://threatpost.com/en_us/blogs/dll-hijacking-facts-and-fiction-082610"
1319 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.
1320 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.",,unclassified,"The Art of Software Security Assessment: Chapter 11, ""Process Loading"", Page 654."
1321 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.
1322 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.",,unclassified,
1323 CWE-430,EN-Deployment of Wrong Handler (Type: Base),"The wrong ""handler"" is assigned to process an object.
1324 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.",,unclassified,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
1325 CWE-431,EN-Missing Handler (Type: Base),"A handler is not available or implemented.
1326 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.",,unclassified,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
1327 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.
1328 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.",,unclassified,
1329 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.
1330 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.",,unclassified,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
1331 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.
1332 This could apply to products, systems, components, etc.",,unclassified,
1333 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.
1334 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.",,unclassified,"On Interpretation Conflict Vulnerabilities
1335 Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection: http://www.insecure.org/stf/secnet_ids/secnet_ids.pdf
1336 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
1337 Poison NULL byte
1338 Re: Corsaire Security Advisory - Multiple vendor MIME RFC2047 encoding: http://marc.theaimsgroup.com/?l=bugtraq&m=109525864717484&w=2"
1339 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.
1340 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.",,unclassified,
1341 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.
1342 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.",,unclassified,
1343 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.
1344 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.",,unclassified,
1345 CWE-440,EN-Expected Behavior Violation (Type: Base),"A feature, API, or function being used by a product behaves differently than the product expects.
1346 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.",,unclassified,
1347 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.
1348 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.
1349 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
1350 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
1351 The attacker is prevented from making the request directly to the target; and
1352 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.",,unclassified,The Confused Deputy (or why capabilities might have been invented): http://www.cap-lore.com/CapTheory/ConfusedDeputy.html
1353 CWE-443,EN-DEPRECATED (Duplicate): HTTP response splitting (Type: Base),"This weakness can be found at CWE-113.
1354 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.
1355 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
1356 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
1357 The attacker is prevented from making the request directly to the target; and
1358 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.",,unclassified,
1359 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.
1360 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.
1361 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
1362 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
1363 The attacker is prevented from making the request directly to the target; and
1364 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.",,unclassified,HTTP Request Smuggling: http://www.cgisecurity.com/lib/HTTP-Request-Smuggling.pdf
1365 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.
1366 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"".",,unclassified,
1367 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.
1368 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"".",,unclassified,
1369 CWE-448,EN-Obsolete Feature in UI (Type: Base),"A UI function is obsolete and the product does not warn the user.
1370 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"".",,unclassified,
1371 CWE-449,EN-The UI Performs the Wrong Action (Type: Base),"The UI performs the wrong action with respect to the user's request.
1372 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"".",,unclassified,
1373 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.
1374 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"".",,unclassified,
1375 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.
1376 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"".",,unclassified,
1377 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.
1378 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"".",,unclassified,
1379 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.
1380 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"".",,unclassified,
1381 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.
1382 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.",,unclassified,
1383 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.
1384 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.",,unclassified,
1385 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.
1386 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.",,unclassified,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
1387 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.
1388 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.",,unclassified,
1389 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.
1390 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.",,unclassified,
1391 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.
1392 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.",,unclassified,
1393 CWE-463,EN-Deletion of Data Structure Sentinel (Type: Base),"The accidental deletion of a data-structure sentinel can cause serious programming logic problems.
1394 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.",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""NUL-Termination Problems"", Page 452."
1395 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.
1396 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
1397 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.
1398 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.",,unclassified,
1399 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.
1400 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.",,unclassified,
1401 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.
1402 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.",,unclassified,
1403 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.
1404 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.
1405 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75
1406 The Art of Software Security Assessment: Chapter 17, ""Embedding State in HTML and URLs"", Page 1032."
1407 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.
1408 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.
1409 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.",,unclassified,
1410 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.
1411 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.
1412 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.",,unclassified,
1413 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.
1414 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.
1415 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.",,unclassified,
1416 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.
1417 NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,unclassified,
1418 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.
1419 NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,unclassified,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
1420 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.
1421 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.
1422 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.",,unclassified,
1423 CWE-485,EN-Insufficient Encapsulation (Type: Class),"The product does not sufficiently encapsulate critical data or functionality.
1424 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.",,unclassified,
1425 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.
1426 Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
1427 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.",,unclassified,
1428 CWE-489,EN-Leftover Debug Code (Type: Base),"The application can be deployed with active debugging code that can create unintended entry points.
1429 Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
1430 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.",,unclassified,
1431 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.
1432 Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
1433 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.",,unclassified,
1434 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.
1435 Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
1436 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.",,unclassified,"OWASP , Attack Category : Mobile code: object hijack: http://www.owasp.org/index.php/Mobile_code:_object_hijack"
1437 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.
1438 An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,unclassified,
1439 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.
1440 An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,unclassified,
1441 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.
1442 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.",,unclassified,
1443 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.
1444 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.",,unclassified,
1445 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.
1446 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.",,unclassified,
1447 CWE-501,EN-Trust Boundary Violation (Type: Base),"The product mixes trusted and untrusted data in the same data structure or structured message.
1448 By combining trusted and untrusted data in the same data structure, it becomes easier for programmers to mistakenly trust unvalidated data.",,unclassified,
1449 CWE-506,EN-Embedded Malicious Code (Type: Class),"The application contains code that appears to be malicious in nature.
1450 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.",,unclassified,
1451 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.
1452 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.",,unclassified,"Writing Secure Code: Chapter 7, ""Viruses, Trojans, and Worms In a Nutshell"" Page 208"
1453 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.
1454 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.",,unclassified,
1455 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.
1456 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.",,unclassified,
1457 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.
1458 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.",,unclassified,
1459 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.
1460 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.",,unclassified,
1461 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.
1462 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.",,unclassified,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
1463 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.
1464 ""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.",,unclassified,
1465 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.
1466 Typically the system has not given authorization for the transmission and has no knowledge of its occurrence.",,unclassified,
1467 CWE-516,EN-DEPRECATED (Duplicate): Covert Timing Channel (Type: Base),"This weakness can be found at CWE-385.
1468 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.",,unclassified,
1469 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.
1470 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.",,unclassified,
1471 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.
1472 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.",,unclassified,
1473 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.
1474 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1475 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.
1476 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1477 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.
1478 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.",,unclassified,
1479 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.
1480 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.",,unclassified,
1481 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.
1482 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.",,unclassified,
1483 CWE-526,EN-Information Exposure Through Environmental Variables (Type: Variant),"Environmental variables may contain sensitive information about a remote server.
1484 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.",,unclassified,
1485 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.
1486 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.",,unclassified,
1487 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.
1488 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.",,unclassified,
1489 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.
1490 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.",,unclassified,
1491 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.
1492 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.",,unclassified,
1493 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.
1494 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.",,unclassified,
1495 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.
1496 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.",,unclassified,
1497 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.
1498 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.",,unclassified,
1499 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.
1500 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.",,unclassified,
1501 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.
1502 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.",,unclassified,
1503 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.
1504 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.",,unclassified,
1505 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.
1506 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.",,unclassified,
1507 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.
1508 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
1509 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.
1510 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.",,unclassified,
1511 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.
1512 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.",,unclassified,
1513 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.
1514 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.",,unclassified,
1515 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.
1516 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.",,unclassified,
1517 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.
1518 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.",,unclassified,
1519 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.
1520 The use of a singleton pattern may not be thread-safe.",,unclassified,Thread-Specifc Storage for C/C++: http://www.cs.wustl.edu/~schmidt/PDF/TSS-pattern.pdf
1521 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.
1522 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.",,unclassified,
1523 CWE-545,EN-Use of Dynamic Class Loading (Type: Variant),"Dynamically loaded code has the potential to be malicious.
1524 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.",,unclassified,
1525 CWE-546,EN-Suspicious Comment (Type: Variant),"The code contains comments that suggest the presence of bugs, incomplete functionality, or weaknesses.
1526 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.",,unclassified,
1527 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.
1528 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.",,unclassified,
1529 CWE-548,EN-Information Exposure Through Directory Listing (Type: Variant),"A directory listing is inappropriately exposed, yielding potentially sensitive information to attackers.
1530 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.",,unclassified,
1531 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.
1532 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.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1533 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.
1534 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.",,unclassified,
1535 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.
1536 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.",,unclassified,
1537 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.
1538 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.",,unclassified,
1539 CWE-552,EN-Files or Directories Accessible to External Parties (Type: Base),"Files or directories are accessible in the environment that should not be.
1540 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.",,unclassified,
1541 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.
1542 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.",,unclassified,
1543 CWE-554,EN-ASP.NET Misconfiguration: Not Using Input Validation Framework (Type: Variant),"The ASP.NET application does not use an input validation framework.
1544 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.",,unclassified,
1545 CWE-555,EN-J2EE Misconfiguration: Plaintext Password in Configuration File (Type: Variant),"The J2EE application stores a plaintext password in a configuration file.
1546 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.",,unclassified,
1547 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.
1548 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.",,unclassified,
1549 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.
1550 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.",,unclassified,
1551 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.
1552 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.",,unclassified,
1553 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().
1554 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.",,unclassified,
1555 CWE-561,EN-Dead Code (Type: Variant),"The software contains dead code, which can never be executed.
1556 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.",,unclassified,
1557 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.
1558 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.",,unclassified,
1559 CWE-563,EN-Unused Variable (Type: Variant),"The variable's value is assigned but never used, making it a dead store.
1560 It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,unclassified,
1561 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.
1562 It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,unclassified,
1563 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.
1564 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.",,unclassified,
1565 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.
1566 When a user can set a primary key to any value, then the user can modify the key to point to unauthorized records.
1567 Database access control errors occur when:
1568 Data enters a program from an untrusted source.
1569 The data is used to specify the value of a primary key in a SQL query.
1570 The untrusted source does not have the permissions to be able to access all rows in the associated table.",,unclassified,
1571 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.
1572 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.
1573 Note that this weakness is not unique to servlets.",,unclassified,
1574 CWE-568,EN-finalize() Method Without super.finalize() (Type: Variant),"The software contains a finalize() method that does not call super.finalize().
1575 The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().",,unclassified,
1576 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.
1577 The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().",,unclassified,
1578 CWE-570,EN-Expression is Always False (Type: Variant),"The software contains an expression that will always evaluate to false.
1579 The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().",,unclassified,
1580 CWE-571,EN-Expression is Always True (Type: Variant),"The software contains an expression that will always evaluate to true.
1581 The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().",,unclassified,
1582 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.
1583 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.",,unclassified,
1584 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.
1585 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.",,unclassified,
1586 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.
1587 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.""",,unclassified,
1588 CWE-575,EN-EJB Bad Practices: Use of AWT Swing (Type: Variant),"The program violates the Enterprise JavaBeans (EJB) specification by using AWT/Swing.
1589 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.""",,unclassified,
1590 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.
1591 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.""",,unclassified,
1592 CWE-577,EN-EJB Bad Practices: Use of Sockets (Type: Variant),"The program violates the Enterprise JavaBeans (EJB) specification by using sockets.
1593 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.""",,unclassified,
1594 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.
1595 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.""",,unclassified,
1596 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.
1597 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.""",,unclassified,
1598 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.
1599 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.",,unclassified,"Writing Secure Code
1600 The Art of Software Security Assessment: Chapter 11, ""DOS 8.3 Filenames"", Page 673."
1601 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.
1602 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.",,unclassified,
1603 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.
1604 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().",,unclassified,
1605 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.
1606 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.",,unclassified,
1607 CWE-583,EN-finalize() Method Declared Public (Type: Variant),"The program violates secure coding principles for mobile code by declaring a finalize() method public.
1608 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.",,unclassified,
1609 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.
1610 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.",,unclassified,
1611 CWE-585,EN-Empty Synchronized Block (Type: Variant),"The software contains an empty synchronized block.
1612 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.",,unclassified,Intrinsic Locks and Synchronization (in Java): http://java.sun.com/docs/books/tutorial/essential/concurrency/locksync.html
1613 CWE-586,EN-Explicit Call to Finalize() (Type: Variant),"The software makes an explicit call to the finalize() method from outside the finalizer.
1614 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.",,unclassified,
1615 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.
1616 Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.",,unclassified,
1617 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.
1618 Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.",,unclassified,
1619 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.
1620 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.",,unclassified,
1621 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().
1622 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.",,unclassified,Valgrind: http://valgrind.org/
1623 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.
1624 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.",,unclassified,
1625 CWE-592,EN-Authentication Bypass Issues (Type: Class),"The software does not properly perform authentication, allowing it to be bypassed through various methods.
1626 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.",,unclassified,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1627 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.
1628 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.",,unclassified,
1629 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.
1630 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.",,unclassified,
1631 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.
1632 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.",,unclassified,
1633 CWE-596,EN-Incorrect Semantic Object Comparison (Type: Base),"The software does not correctly compare two objects based on their conceptual content.
1634 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.",,unclassified,
1635 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.
1636 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.",,unclassified,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
1637 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.
1638 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.",,unclassified,
1639 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.
1640 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.",,unclassified,
1641 CWE-6,EN-J2EE Misconfiguration: Insufficient Session-ID Length (Type: Variant),"The J2EE application is configured to use an insufficient session ID length.
1642 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.",,unclassified,No description: http://www.securiteam.com/securityreviews/5TP0F0UEVQ.html
1643 CWE-600,EN-Uncaught Exception in Servlet (Type: Base),"The Servlet does not catch all exceptions, which may reveal sensitive debugging information.
1644 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.",,unclassified,
1645 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.
1646 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.",,unclassified,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1647 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.
1648 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.",,unclassified,
1649 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.
1650 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.",,unclassified,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1651 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.
1652 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.",,unclassified,
1653 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.
1654 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.",,unclassified,
1655 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.
1656 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.",,unclassified,"The ""Double-Checked Locking is Broken"" Declaration: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
1657 JSR 133 (Java Memory Model) FAQ: http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#dcl
1658 The Art of Software Security Assessment: Chapter 13, ""Threading Vulnerabilities"", Page 815."
1659 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.
1660 ",,unclassified,
1661 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.
1662 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.
1663 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.
1664 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.",,unclassified,"XML External Entity (XXE) Processing: https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
1665 XML External Entity Attacks (XXE): https://www.owasp.org/images/5/5d/XML_Exteral_Entity_Attack.pdf
1666 XXE (Xml eXternal Entity) Attack: http://www.securiteam.com/securitynews/6D0100A5PU.html
1667 XML External Entities (XXE) Attack: http://projects.webappsec.org/w/page/13247003/XML%20External%20Entities
1668 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
1669 Preventing XXE in PHP: http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html"
1670 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.
1671 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.",,unclassified,
1672 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.""
1673 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.",,unclassified,
1674 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.
1675 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.",,unclassified,
1676 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.
1677 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.",,unclassified,
1678 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.
1679 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"".",,unclassified,"A Study in Scarlet - section 5, ""File Upload"""
1680 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.
1681 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.",,unclassified,
1682 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).
1683 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.",,unclassified,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1684 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
1685 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1686 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.""
1687 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.",,unclassified,"The Oracle Hacker's Handbook
1688 Cursor Injection: http://www.databasesecurity.com/dbsec/cursor-injection.pdf"
1689 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.
1690 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.",,unclassified,"The Art of Software Security Assessment: Chapter 9, ""Hard Links"", Page 518."
1691 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.
1692 This could be used by an attacker to change passwords for another user, thus gaining the privileges associated with that user.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1693 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.
1694 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.",,unclassified,
1695 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.
1696 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.",,unclassified,
1697 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.
1698 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.",,unclassified,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1699 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
1700 No description: http://support.microsoft.com/kb/240797
1701 Writing Secure Code: Chapter 16, ""What ActiveX Components Are Safe for Initialization and Safe for Scripting?"" Page 510
1702 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1703 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.
1704 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.",,unclassified,
1705 CWE-625,EN-Permissive Regular Expression (Type: Base),"The product uses a regular expression that does not sufficiently restrict the set of allowed values.
1706 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:
1707 not identifying the beginning and end of the target string
1708 using wildcards instead of acceptable character ranges
1709 others",,unclassified,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
1710 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.
1711 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.",,unclassified,"Poison NULL byte: http://insecure.org/news/P55-07.txt
1712 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
1713 ShAnKaR: multiple PHP application poison NULL byte vulnerability: http://seclists.org/fulldisclosure/2006/Sep/0185.html"
1714 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.
1715 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.",,unclassified,"Dynamic Evaluation Vulnerabilities in PHP applications: http://seclists.org/fulldisclosure/2006/May/0035.html
1716 A Study In Scarlet: Exploiting Common Vulnerabilities in PHP Applications: http://www.securereality.com.au/studyinscarlet.txt"
1717 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.
1718 There are multiple ways in which this weakness can be introduced, including:
1719 the wrong variable or reference;
1720 an incorrect number of arguments;
1721 incorrect order of arguments;
1722 wrong type of arguments; or
1723 wrong value.",,unclassified,
1724 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.
1725 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.""",,unclassified,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1726 Failing Securely: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/349.html"
1727 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.
1728 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.",,unclassified,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1729 Economy of Mechanism: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/348.html"
1730 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.
1731 ",,unclassified,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1732 Complete Mediation: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/346.html"
1733 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.
1734 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.",,unclassified,"The Art of Software Security Assessment: Chapter 11, ""Links"", Page 676."
1735 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).
1736 An information exposure may occur if any of the following apply:
1737 The WSDL file is accessible to a wider audience than intended.
1738 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.
1739 Information in the WSDL file helps guess names/locations of methods/resources that should not be publicly accessible.",,unclassified,
1740 CWE-653,EN-Insufficient Compartmentalization (Type: Base),"The product does not sufficiently compartmentalize functionality or processes that require different privilege levels, rights, or permissions.
1741 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.",,unclassified,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1742 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1743 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.
1744 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.",,unclassified,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1745 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1746 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.
1747 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.",,unclassified,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1748 Psychological Acceptability: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/354.html
1749 Usability of Security: A Case Study: http://reports-archive.adm.cs.cmu.edu/anon/1998/CMU-CS-98-155.pdf
1750 24 Deadly Sins of Software Security: ""Sin 14: Poor Usability."" Page 217"
1751 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.
1752 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.",,unclassified,"RFC: 793, TRANSMISSION CONTROL PROTOCOL: http://www.ietf.org/rfc/rfc0793.txt
1753 The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1754 Never Assuming that Your Secrets Are Safe: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/352.html"
1755 CWE-657,EN-Violation of Secure Design Principles (Type: Class),"The product violates well-established principles for secure design.
1756 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.",,unclassified,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1757 Design Principles: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/358.html"
1758 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.
1759 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.",,unclassified,
1760 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.
1761 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.",,unclassified,
1762 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.
1763 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.",,unclassified,"Java Concurrency API: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReentrantLock.html
1764 Use reentrant functions for safer signal handling: http://www.ibm.com/developerworks/linux/library/l-reent.html"
1765 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.
1766 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.
1767 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.""",,unclassified,
1768 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.
1769 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.",,unclassified,
1770 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.
1771 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.",,unclassified,
1772 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.
1773 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.
1774 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.
1775 In either case, the end result is that a resource has been exposed to the wrong party.",,unclassified,
1776 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.
1777 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.
1778 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.
1779 In either case, the end result is that a resource has been exposed to the wrong party.",,unclassified,
1780 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.
1781 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.",,unclassified,
1782 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.
1783 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.",,unclassified,
1784 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.
1785 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.",,unclassified,
1786 CWE-673,EN-External Influence of Sphere Definition (Type: Class),"The product does not prevent the definition of control spheres from external actors.
1787 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.",,unclassified,
1788 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.
1789 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.",,unclassified,
1790 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.
1791 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.",,unclassified,
1792 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.
1793 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.",,unclassified,
1794 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.
1795 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.",,unclassified,
1796 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.
1797 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.",,unclassified,
1798 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.
1799 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.",,unclassified,
1800 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.
1801 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.",,unclassified,
1802 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.
1803 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.",,unclassified,
1804 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).
1805 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.",,unclassified,"Windows NTFS Alternate Data Streams: http://www.securityfocus.com/infocus/1822
1806 Writing Secure Code"
1807 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.
1808 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.",,unclassified,
1809 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.
1810 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.",,unclassified,
1811 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.
1812 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.",,unclassified,
1813 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.
1814 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.",,unclassified,
1815 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.
1816 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.",,unclassified,
1817 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.
1818 This weakness class covers several possibilities:
1819 the comparison checks one factor incorrectly;
1820 the comparison should consider multiple factors, but it does not check some of those factors at all.",,unclassified,
1821 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.
1822 This weakness class covers several possibilities:
1823 the comparison checks one factor incorrectly;
1824 the comparison should consider multiple factors, but it does not check some of those factors at all.",,unclassified,Fear the EAR: Discovering and Mitigating Execution After Redirect Vulnerabilities: http://cs.ucsb.edu/~bboe/public/pubs/fear-the-ear-ccs2011.pdf
1825 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.
1826 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.",,unclassified,19 Deadly Sins of Software Security
1827 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.
1828 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.",,unclassified,"A Taxonomy of Security Faults in the UNIX Operating System: http://ftp.cerias.purdue.edu/pub/papers/taimur-aslam/aslam-taxonomy-msthesis.pdf
1829 Use of A Taxonomy of Security Faults: http://csrc.nist.gov/nissc/1996/papers/NISSC96/paper057/PAPER.PDF
1830 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
1831 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.
1832 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.",,unclassified,
1833 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.
1834 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.",,unclassified,
1835 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.
1836 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.",,unclassified,
1837 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.
1838 If a message is malformed it may cause the message to be incorrectly interpreted.
1839 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.",,unclassified,
1840 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.
1841 This may allow the resource to be manipulated by actors outside of the intended control sphere.",,unclassified,
1842 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.
1843 This may allow the resource to be manipulated by actors outside of the intended control sphere.",,unclassified,
1844 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.
1845 This may allow the resource to be manipulated by actors outside of the intended control sphere.",,unclassified,
1846 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.
1847 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.",,unclassified,No description: http://docs.info.apple.com/article.html?artnum=300422
1848 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.
1849 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.",,unclassified,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322"
1850 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.
1851 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.
1852 The exposure can occur in a few different ways:
1853 1) The function/method was never intended to be exposed to outside actors.
1854 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.",,unclassified,
1855 CWE-756,EN-Missing Custom Error Page (Type: Class),"The software does not return custom error pages to the user, possibly exposing sensitive information.
1856 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.
1857 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.",,unclassified,
1858 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.
1859 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.",,unclassified,
1860 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.
1861 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.",,unclassified,
1862 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.
1863 This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables.
1864 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.",,unclassified,"bcrypt: http://bcrypt.sourceforge.net/
1865 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1866 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1867 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1868 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1869 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1870 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1871 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1872 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1873 Password Hashing: http://phpsec.org/articles/2005/password-hashing.html
1874 Rainbow Hash Cracking: http://www.codinghorror.com/blog/archives/000949.html
1875 Rainbow table: http://en.wikipedia.org/wiki/Rainbow_table
1876 Writing Secure Code: Chapter 9, ""Creating a Salted Hash"" Page 302
1877 The Art of Software Security Assessment: Chapter 2, ""Salt Values"", Page 46.
1878 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1879 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1880 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1881 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.
1882 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.
1883 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.",,unclassified,"bcrypt: http://bcrypt.sourceforge.net/
1884 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1885 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1886 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1887 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1888 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1889 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1890 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1891 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1892 Password Hashing: http://phpsec.org/articles/2005/password-hashing.html
1893 Rainbow Hash Cracking: http://www.codinghorror.com/blog/archives/000949.html
1894 Rainbow table: http://en.wikipedia.org/wiki/Rainbow_table
1895 Writing Secure Code: Chapter 9, ""Creating a Salted Hash"" Page 302
1896 The Art of Software Security Assessment: Chapter 2, ""Salt Values"", Page 46.
1897 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1898 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1899 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1900 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.
1901 This can cause the application to crash, or in some cases, modify critical program variables or execute code.
1902 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.",,unclassified,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
1903 Valgrind: http://valgrind.org/"
1904 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.
1905 This weakness can take several forms, such as:
1906 The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762).
1907 The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.",,unclassified,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
1908 Valgrind: http://valgrind.org/"
1909 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.
1910 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.",,unclassified,
1911 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.
1912 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.",,unclassified,
1913 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.
1914 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.",,unclassified,
1915 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.
1916 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.",,unclassified,
1917 CWE-787,EN-Out-of-bounds Write (Type: Base),"The software writes data past the end, or before the beginning, of the intended buffer.
1918 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.",,unclassified,
1919 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.
1920 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.",,unclassified,
1921 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.
1922 Cross-site scripting (XSS) vulnerabilities occur when:
1923 1. Untrusted data enters a web application, typically from a web request.
1924 2. The web application dynamically generates a web page that contains this untrusted data.
1925 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.
1926 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
1927 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.
1928 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.
1929 There are three main kinds of XSS:
1930 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.
1931 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.
1932 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.
1933 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.""
1934 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.",,unclassified,
1935 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.
1936 Cross-site scripting (XSS) vulnerabilities occur when:
1937 1. Untrusted data enters a web application, typically from a web request.
1938 2. The web application dynamically generates a web page that contains this untrusted data.
1939 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.
1940 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
1941 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.
1942 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.
1943 There are three main kinds of XSS:
1944 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.
1945 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.
1946 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.
1947 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.""
1948 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.",,unclassified,
1949 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.
1950 Incomplete filtering of this nature involves either
1951 only filtering a single instance of a special element when more exist, or
1952 not filtering all instances or all elements where multiple special elements exist.",,unclassified,
1953 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.
1954 Incomplete filtering of this nature may be location-dependent, as in only the first or last element is filtered.",,unclassified,
1955 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.
1956 Incomplete filtering of this nature may be applied to
1957 sequential elements (special elements that appear next to each other) or
1958 non-sequential elements (special elements that appear multiple times in different locations).",,unclassified,
1959 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.
1960 A filter might only account for instances of special elements when they occur:
1961 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1962 at an absolute position (e.g. ""byte number 10"").
1963 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,unclassified,
1964 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.
1965 A filter might only account for instances of special elements when they occur:
1966 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1967 at an absolute position (e.g. ""byte number 10"").
1968 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,unclassified,
1969 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.
1970 A filter might only account for instances of special elements when they occur:
1971 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1972 at an absolute position (e.g. ""byte number 10"").
1973 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,unclassified,
1974 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.
1975 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.",,unclassified,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
1976 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.
1977 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.",,unclassified,
1978 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.
1979 Error pages may include customized 403 Forbidden or 404 Not Found pages.
1980 When an attacker can trigger an error that contains unneutralized input, then cross-site scripting attacks may be possible.",,unclassified,"24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183"
1981 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.
1982 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.",,unclassified,
1983 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.
1984 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.",,unclassified,
1985 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.
1986 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.",,unclassified,
1987 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.
1988 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).
1989 There are several variants of this weakness, including but not necessarily limited to:
1990 The untrusted value is directly invoked as a function call.
1991 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).
1992 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.",,unclassified,
1993 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.
1994 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.
1995 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.
1996 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.",,unclassified,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
1997 CWE-824,EN-Access of Uninitialized Pointer (Type: Base),"The program accesses or uses a pointer that has not been initialized.
1998 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.
1999 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.",,unclassified,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
2000 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.
2001 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.",,unclassified,
2002 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.
2003 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.
2004 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.",,unclassified,
2005 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.
2006 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.
2007 For example, the SOAP specification prohibits SOAP messages from containing DTDs.",,unclassified,Apache CXF Security Advisory (CVE-2010-2076): http://svn.apache.org/repos/asf/cxf/trunk/security/CVE-2010-2076.pdf
2008 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.
2009 This can lead to an unexpected system state with a variety of potential consequences depending on context, including denial of service and code execution.
2010 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.
2011 There are several different scenarios that introduce this issue:
2012 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.
2013 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.
2014 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).
2015 Note that in some environments or contexts, it might be possible for the signal handler to be interrupted itself.
2016 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.",,unclassified,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
2017 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
2018 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.
2019 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.
2020 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).",,unclassified,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
2021 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
2022 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.
2023 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.
2024 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).",,unclassified,
2025 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.
2026 Including third party functionality in a web-based environment is risky, especially if the source of the functionality is untrusted.
2027 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.
2028 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.
2029 Such dependencies may be desirable, or even required, but sometimes programmers are not aware that a dependency exists.",,unclassified,Third-Party Web Widget Security FAQ: http://jeremiahgrossman.blogspot.com/2010/07/third-party-web-widget-security-faq.html
2030 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.
2031 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.
2032 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.
2033 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.",,unclassified,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
2034 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
2035 CWE-832,EN-Unlock of a Resource that is not Locked (Type: Base),"The software attempts to unlock a resource that is not locked.
2036 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).",,unclassified,
2037 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.
2038 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).",,unclassified,"The Art of Software Security Assessment: Chapter 13, ""Synchronization Problems"" / ""Starvation and Deadlocks"", Page 760
2039 The Art of Software Security Assessment: Chapter 13, ""Starvation and Deadlocks"", Page 760.
2040 Secure Coding in C and C++: Chapter 7, ""Concurrency"", section ""Mutual Exclusion and Deadlock"", Page 248."
2041 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.
2042 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.",,unclassified,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
2043 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.
2044 If the loop can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory.",,unclassified,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
2045 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.
2046 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.
2047 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.",,unclassified,
2048 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.
2049 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.",,unclassified,
2050 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.
2051 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.
2052 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.
2053 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.
2054 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.",,unclassified,"Injection-safe templating languages: http://manicode.blogspot.com/2010/06/injection-safe-templating-languages_30.html
2055 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
2056 Canoe: XSS prevention via context-aware output encoding: http://blog.ivanristic.com/2010/09/introducing-canoe-context-aware-output-encoding-for-xss-prevention.html
2057 What is the Future of Automated XSS Defense Tools?: http://software-security.sans.org/downloads/appsec-2011-files/manico-appsec-future-tools.pdf
2058 XSS Attacks: Preventing XSS Attacks
2059 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
2060 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
2061 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.
2062 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.
2063 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.",,unclassified,"The Art of Software Security Assessment: Chapter 6, ""Type Conversion Vulnerabilities"" Page 246.
2064 The Art of Software Security Assessment: Chapter 6, ""Comparisons"", Page 265."
2065 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.
2066 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.
2067 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.",,unclassified,
2068 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.
2069 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.
2070 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.
2071 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.
2072 Workflow-related behaviors include:
2073 Steps are performed in the expected order.
2074 Required steps are not omitted.
2075 Steps are not interrupted.
2076 Steps are performed in a timely fashion.",,unclassified,"Business Logic Flaws and Yahoo Games: http://jeremiahgrossman.blogspot.com/2006/12/business-logic-flaws.html
2077 Seven Business Logic Flaws That Put Your Website At Risk: http://www.whitehatsec.com/home/assets/WP_bizlogic092407.pdf
2078 Business Logic Flaws: http://www.whitehatsec.com/home/solutions/BL_auction.html
2079 Insufficient Process Validation: http://projects.webappsec.org/w/page/13246943/Insufficient-Process-Validation
2080 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
2081 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
2082 Toward Automated Detection of Logic Vulnerabilities in Web Applications: http://www.usenix.org/events/sec10/tech/full_papers/Felmetsger.pdf
2083 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"
2084 CWE-842,EN-Placement of User into Incorrect Group (Type: Base),"The software or the administrator places a user into an incorrect group.
2085 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.",,unclassified,
2086 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.
2087 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.
2088 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.
2089 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.",,unclassified,"Attacking Interoperability: http://www.azimuthsecurity.com/resources/bh2009_dowd_smith_dewey.pdf
2090 The Art of Software Security Assessment: Chapter 7, ""Type Confusion"", Page 319."
2091 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.
2092 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.
2093 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.
2094 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.",,unclassified,
2095 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.
2096 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.",,unclassified,
2097 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.
2098 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.
2099 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.",,unclassified,
2100 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.
2101 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.
2102 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.",,unclassified,"Argument injection issues: http://www.securityfocus.com/archive/1/archive/1/460089/100/100/threaded
2103 The Art of Software Security Assessment: Chapter 10, ""The Argument Array"", Page 567."
2104 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.
2105 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.
2106 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.",,unclassified,
2107 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.
2108 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.
2109 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.",,unclassified,Web Applications and LDAP Injection
2110 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.
2111 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.",,unclassified,"Blind XPath Injection: http://www.modsecurity.org/archive/amit/blind-xpath-injection.pdf
2112 The Art of Software Security Assessment: Chapter 17, ""XML Injection"", Page 1069."
2113 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.
2114 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.",,unclassified,
2115 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.
2116 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.",,unclassified,
2117 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.
2118 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.",,unclassified,
2119 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.
2120 If the object contains attributes that were only intended for internal use, then their unexpected modification could lead to a vulnerability.
2121 This weakness is sometimes known by the language-specific mechanisms that make it possible, such as mass assignment, autobinding, or object injection.",,unclassified,"Shocking News in PHP Exploitation: http://www.suspekt.org/downloads/POC2009-ShockingNewsInPHPExploitation.pdf
2122 ""Two Security Vulnerabilities in the Spring Framework's MVC"" pdf (from 2008): http://blog.diniscruz.com/2011/07/two-security-vulnerabilities-in-spring.html
2123 Two Security Vulnerabilities in the Spring Framework's MVC: http://o2platform.files.wordpress.com/2011/07/ounce_springframework_vulnerabilities.pdf
2124 Best Practices for ASP.NET MVC: http://blogs.msdn.com/b/aspnetue/archive/2010/09/17/second_2d00_post.aspx
2125 Mass assignment in Rails applications: http://blog.mhartl.com/2008/09/21/mass-assignment-in-rails-applications/
2126 Secure your Rails apps!: http://pragtob.wordpress.com/2012/03/06/secure-your-rails-apps/
2127 Ruby On Rails Security Guide: http://guides.rubyonrails.org/security.html#mass-assignment
2128 Mass Assignment Vulnerability in ASP.NET MVC: http://freshbrewedcode.com/joshbush/2012/03/05/mass-assignment-aspnet-mvc/
2129 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
2130 PHP Object Injection: https://www.owasp.org/index.php/PHP_Object_Injection
2131 Unserializing user-supplied data, a bad idea: http://heine.familiedeelstra.com/security/unserialize
2132 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
2133 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.
2134 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.
2135 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.
2136 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
2137 The amount of CPU time required to compute the hash (""stretching"")
2138 The amount of memory required to compute the hash (""memory-hard"" operations)
2139 Including a random value, along with the password, as input to the hash computation (""salting"")
2140 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)
2141 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"")
2142 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.",,unclassified,"bcrypt: http://bcrypt.sourceforge.net/
2143 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
2144 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
2145 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
2146 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
2147 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
2148 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
2149 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
2150 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
2151 Password hashing at scale: http://www.openwall.com/presentations/YaC2012-Password-Hashing-At-Scale/
2152 New developments in password hashing: ROM-port-hard functions: http://www.openwall.com/presentations/ZeroNights2012-New-In-Password-Hashing/
2153 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
2154 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
2155 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
2156 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.
2157 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.
2158 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.
2159 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
2160 The amount of CPU time required to compute the hash (""stretching"")
2161 The amount of memory required to compute the hash (""memory-hard"" operations)
2162 Including a random value, along with the password, as input to the hash computation (""salting"")
2163 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)
2164 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"")
2165 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.",,unclassified,"Expression Language Injection: http://www.mindedsecurity.com/fileshare/ExpressionLanguageInjection.pdf
2166 Remote Code with Expression Language Injection: http://danamodio.com/application-security/discoveries/spring-remote-code-with-expression-language-injection/"
2167 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.
2168 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.",,unclassified,"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
2169 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
2170 Cross Site Port Attacks - XSPA - Part 1: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-1.html
2171 Cross Site Port Attacks - XSPA - Part 2: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-2.html
2172 Cross Site Port Attacks - XSPA - Part 3: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-3.html
2173 SSRF attacks and sockets: smorgasbord of vulnerabilities: http://www.slideshare.net/d0znpp/ssrf-attacks-and-sockets-smorgasbord-of-vulnerabilities
2174 SSRF bible. Cheatsheet: https://docs.google.com/document/d/1v1TkWZtrhzRLy0bYXBcdLUedXGb9njTNIJXa3u9akHM/edit?pli=1#
2175 Web Portals: Gateway To Information, Or A Hole In Our Perimeter Defenses: http://www.shmoocon.org/2008/presentations/Web%20portals,%20gateway%20to%20information.ppt"
2176 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.
2177 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.",,unclassified,
2178 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.
2179 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.
2180 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:
2181 Display
2182 CPU
2183 Disk I/O
2184 GPS
2185 Sound
2186 Microphone
2187 USB interface",,unclassified,
2188 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.
2189 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.
2190 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.",,unclassified,Security Tips: http://developer.android.com/training/articles/security-tips.html#StoringData
2191 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.
2192 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.",,unclassified,
2193 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.
2194 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.
2195 While this issue frequently involves authentication between network-based clients and servers, other types of communication channels and endpoints can have this weakness.",,unclassified,
2196 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.
2197 A man-in-the-middle (MITM) attacker might be able to modify the message and spoof the endpoint.",,unclassified,
2198 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.
2199 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.",,unclassified,
2200 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.
2201 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.
2202 This weakness could be expressed in several different ways:
2203 The Content Provider is only intended for internal use by the application, and thus does not need to be exported.
2204 In Android before 4.2, the Content Provider is automatically exported unless it has been explicitly declared as NOT exported.
2205 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.",,unclassified,No description: http://developer.android.com/training/articles/security-tips.html#ContentProviders
2206 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.
2207 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.",,unclassified,"Analyzing Inter-Application Communication in Android: http://www.cs.berkeley.edu/~afelt/intentsecurity-mobisys.pdf
2208 Security Tips: http://developer.android.com/training/articles/security-tips.html#ContentProviders"
2209 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.
2210 This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,unclassified,
2211 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.
2212 This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,unclassified,
2213 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.
2214 Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
2215 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"").
2216 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.",,high,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
2217 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
2218 Output Sanitization: http://www.analyticalengine.net/archives/58
2219 Sanitizing user data: How and where to do it: http://www.diovo.com/2008/09/sanitizing-user-data-how-and-where-to-do-it/
2220 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
2221 Input Validation - Not That Important: http://manicode.blogspot.com/2008/08/input-validation-not-that-important.html
2222 Preventing XSS with Correct Output Encoding: http://phed.org/2008/05/19/preventing-xss-with-correct-output-encoding/
2223 Writing Secure Code: Chapter 11, ""Canonical Representation Issues"" Page 363"
2224 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).
2225 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,"Writing Secure Code: Chapter 5, ""Stack Overruns"" Page 129
2226 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
2227 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
2228 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
2229 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.
2230 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,"Format String Vulnerabilities in Perl Programs: http://www.securityfocus.com/archive/1/418460/30/0/threaded
2231 Programming Language Format String Vulnerabilities: http://www.ddj.com/dept/security/197002914
2232 Format String Attacks: http://www.thenewsh.com/~newsham/format-string-attacks.pdf
2233 Writing Secure Code: Chapter 5, ""Format String Bugs"" Page 147
2234 24 Deadly Sins of Software Security: ""Sin 6: Format String Problems."" Page 109
2235 The Art of Software Security Assessment: Chapter 8, ""C Format Strings"", Page 422."
2236 CWE-256,EN-Plaintext Storage of a Password (Type: Variant),"Storing a password in plaintext may result in a system compromise.
2237 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.",,high,Building Secure Software: How to Avoid Security Problems the Right Way
2238 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.
2239 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.",,high,
2240 CWE-258,EN-Empty Password in Configuration File (Type: Variant),"Using an empty string as a password is insecure.
2241 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.",,high,Building Secure Software: How to Avoid Security Problems the Right Way
2242 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.
2243 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:
2244 Inbound: the software contains an authentication mechanism that checks for a hard-coded password.
2245 Outbound: the software connects to another system or component, and it contains hard-coded password for connecting to that component.
2246 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.
2247 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.",,high,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
2248 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.
2249 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,
2250 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.
2251 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.",,high,
2252 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.
2253 Command injection vulnerabilities typically occur when:
2254 1. Data enters the application from an untrusted source.
2255 2. The data is part of a string that is executed as a command by the application.
2256 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,high,"Exploiting Software: How to Break Code
2257 24 Deadly Sins of Software Security: ""Sin 10: Command Injection."" Page 171"
2258 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.
2259 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:
2260 Inbound: the software contains an authentication mechanism that checks the input credentials against a hard-coded set of credentials.
2261 Outbound: the software connects to another system or component, and it contains hard-coded credentials for connecting to that component.
2262 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.
2263 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.",,high,"Writing Secure Code: Chapter 8, ""Key Management Issues"" Page 272
2264 Top 25 Series - Rank 11 - Hardcoded Credentials: http://blogs.sans.org/appsecstreetfighter/2010/03/10/top-25-series-rank-11-hardcoded-credentials/
2265 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
2266 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.
2267 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.
2268 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.",,high,"24 Deadly Sins of Software Security: ""Sin 1: SQL Injection."" Page 3
2269 Writing Secure Code: Chapter 12, ""Database Input Issues"" Page 397
2270 SQL Injection Prevention Cheat Sheet: http://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
2271 SQL Injection Attacks by Example: http://www.unixwiz.net/techtips/sql-injection.html
2272 SQL Injection Cheat Sheet: http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/
2273 The Database Hacker's Handbook: Defending Database Servers
2274 The Oracle Hacker's Handbook: Hacking and Defending Oracle
2275 SQL Injection: http://msdn.microsoft.com/en-us/library/ms161953.aspx
2276 SQL Injection Attack: http://blogs.technet.com/swi/archive/2008/05/29/sql-injection-attack.aspx
2277 Giving SQL Injection the Respect it Deserves: http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx
2278 Top 25 Series - Rank 2 - SQL Injection: http://blogs.sans.org/appsecstreetfighter/2010/03/01/top-25-series-rank-2-sql-injection/
2279 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
2280 The Art of Software Security Assessment: Chapter 8, ""SQL Queries"", Page 431.
2281 The Art of Software Security Assessment: Chapter 17, ""SQL Injection"", Page 1061."
2282 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.
2283 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.",,low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
2284 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.
2285 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.",,low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
2286 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.
2287 ","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.
2288 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.
2289 Finally, the usage of short circuit evaluation may decrease the maintainability of the code.",low,
2290 ,Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales
2291 ","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",unclassified,
2292 ,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.
2293 ",Si es posible se deberia habilitar la flag Secure para esta cookie,low,
2294 ,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
2295 ",Si es posible se deberia habilitar la flag HTTPOnly para esta cookie,low,
2296 ,ES-Apache httpd Remote Denial of Service,"* Alerta generada por el flag del servidor: ver: 2.2.15 *
2297 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.
2298 ",Actualizar version de apache,medium,
2299 ,ES-Robots.txt,"Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.
2300 ","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)
2301 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
2302 Disallow: /*AB/$
2303 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.",informational,
2304 ,ES-Typical Login Web,"Archivo de Login nombrado de manera ""comun"".
2305 ",Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,unclassified,
2306 ,ES-Credentials en Texto Plano,"Las Credenciales de usuario son trasmitidas por un canal sin cifrar y puede ser interceptada.
2307 ",Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),medium,
2308 ,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.
2309 ","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>
2310 <machineKey validation=""3DES""/>",unclassified,
2311 ,ES-Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
2312
2313 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
2314 style=""border-width:0px;"" />
2315
2316 Siendo la respuesta THHvB
2317
2318 Facilitando la manera de automatizar un script para atacar el form
2319 ",Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,unclassified,
2320 ,"ES-Mensaje de error de la aplicacion
2321 (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
2322 ","Se recomienda deshabilitar los mensajes de error, para no proporcionar información de la tecnología o software implementado.
2323
2324 ",low,
2325 ,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.
2326 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php
2327 ",Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,medium,
2328 ,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.
2329 ","Se recomienta establecer el input con Autocomplete OFF:
2330 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",low,
2331 ,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.
2332 ",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.,unclassified,
2333 ,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.
2334 ","Se recomienda llamar a estos directorios de manera no estandard, por ejemplo:
2335 config-->c0nfig05
2336 backup-->b4ccup
2337 Aunque es aun mas recomendabl, de ser posible, no dejar directorios de backup, configuracion, etc accesibles directamente desde la web",unclassified,
2338 ,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.
2339 ",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,
2340 ,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
2341 ","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,
2342 ,"ES-XSS Cross Site Scripting
2343 (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.
2344 ","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,
2345 ,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.
2346 ",Se recomienda desactivar SSL 2.0 y usar SSL 3.0 o TLS 1.0 en su lugar.,high,
2347 ,"ES-OPTIONS method is enabled
2348 (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
2349 ",Es recomendado desactivar el metodo OPTIONS en un servidor en produccion.,low,
2350 ,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.
2351 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.
2352 ",http://www.g-sec.lu/practicaltls.pdf,unclassified,
2353 ,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.
2354 ","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.
2355
2356 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.",unclassified,
2357 CWE-319,"ES-Credenciales enviadas por un canal en texto plano
2358 (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.
2359
2360 Una tercera persona puede ser capaz de leer las credenciales de usuario mediante la interceptación de una conexión no cifrada de HTTP.
2361 ","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,
2362 ,ES-URL Redirection,"Este script es vulnerable a los ataques de redireccion por URL
2363
2364 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.
2365 ","El script debe filtrar los sitios destinos del redirect, manteniendolo siempre dentro de los dominios validos.",unclassified,
2366 ,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
2367 ","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",unclassified,
2368 ,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.
2369 ",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.,unclassified,
2370 ,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.
2371 ","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.
2372 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.
2373 Guía de cómo evitar estos ataques (en inglés): https://www.owasp.org/index.php/Guide_to_SQL_Injection",high,
2374 ,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.
2375 ","Es posible que el modo debug muestre datos sensibles del servidor.
2376 Mas informacion de como desactivar el modo debug:
2377 http://support.microsoft.com/default.aspx?scid=kb;es-us;815157",unclassified,
2378 ,ES-Unicode tranfsormation Issues,"La pagina es vulnerable a varias tranformaciones de Unicode como ""Best-Fit Mappings"", ""Overlong byte sequences"" y ""Ill-formed sequences"".
2379 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.
2380
2381 ************************************
2382
2383 ""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:
2384 0xC0 0x8A
2385 0xE0 0x80 0x8A
2386 0xF0 0x80 0x80 0x8A
2387 0xF8 0x80 0x80 0x80 0x8A
2388 0xFC 0x80 0x80 0x80 0x80 0x8A
2389
2390 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.
2391
2392
2393 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.
2394 ","Se debe identificar el origen de esta tranformacion Unicode y reparar el problema. Se deja links a paginas con informacion:
2395 Links with more information:
2396 http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf
2397 http://www.cl.cam.ac.uk/~mgk25/unicode.html
2398 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
2399 http://www.unicode.org/reports/tr36/",unclassified,
2400 ,"ES-File Upload XSS
2401 (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.
2402
2403 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.
2404 ","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.
2405 Links con mas informacion:
2406 https://www.owasp.org/index.php/Unrestricted_File_Upload
2407 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",unclassified,
2408 ,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.
2409 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.
2410 ","Update to the latest version of jQuery.
2411 More info: http://ma.la/jquery_xss/
2412 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",unclassified,
2413 ,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:
2414
2415 <link href=""http://_SERVER['HOST']"" (Joomla)
2416
2417 ...haciendo un apend de keys secretas y tokens:
2418 <a href=""http://_SERVER['HOST']?token=topsecret""> (Django, Gallery y otros)
2419 ....e importante directamente scripts:
2420 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)
2421 ","La aplicacion web deberia usar una variable ""SERVER_NAME"" en lugar de basarse en le Host header.",high,
2422 ,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
2423
2424 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).
2425 ","Es recomendable implementar algun tipo de bloqueo de intentos de login tras un numero de fallos en los intentos.
2426 Mas información:
2427 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",unclassified,
2428 ,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
2429 ",Se debe configurar paginas de error customizadas evitando mostrar esta informacion.,low,
2430 ,ES-Weak SSL,"El servidor esta utiizando un cifrado SSL dèbil.
2431
2432 Weak SSL ciphers (SSL2 on port 443):
2433
2434 SSL2_CK_RC4_128_EXPORT40_WITH_MD5 - Low strength
2435 SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 - Low strength
2436 SSL2_CK_DES_64_CBC_WITH_MD5 - Low strength
2437
2438 Weak SSL ciphers (SSL3 on port 443):
2439
2440 SSL3_CK_RSA_RC4_40_MD5 - Low strength
2441 SSL3_CK_RSA_RC2_40_MD5 - Low strength
2442 SSL3_CK_RSA_DES_40_CBC_SHA - Low strength
2443 SSL3_CK_RSA_DES_64_CBC_SHA - Low strength
2444 SSL3_CK_EDH_RSA_DES_40_CBC_SHA - Low strength
2445 SSL3_CK_EDH_RSA_DES_64_CBC_SHA - Low strength
2446
2447 Weak SSL ciphers (TLS1 on port 443):
2448
2449 TLS1_CK_RSA_EXPORT_WITH_RC4_40_MD5 - Low strength
2450 TLS1_CK_RSA_EXPORT_WITH_RC2_CBC_40_MD5 - Low strength
2451 TLS1_CK_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
2452 TLS1_CK_RSA_WITH_DES_CBC_SHA - Low strength
2453 TLS1_CK_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
2454 TLS1_CK_DHE_RSA_WITH_DES_CBC_SHA - Low strength
2455 ",Reconfigurar el servidor para encriptado mas fuerte.,unclassified,
2456 ,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.
2457
2458 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.
2459 ","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.
2460
2461 Referencias WEB.
2462 http://blogs.cisco.com/security/breach-crime-and-blackhat/
2463 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
2464 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",high,
2465 ,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.
2466 ",El destino del FORM debe apuntar a una pagina segura (https),unclassified,
2467 ,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.
2468
2469 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.
2470 ","Se recomienda desactivar el metodo TRACE en el servidor web.
2471
2472 Referencias WEB:
2473 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
2474 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",low,
2475 ,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
2476
2477 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.
2478 ","Si se tiene cualquier certificado de 1024-bito certificados con menos de 2048-bit de largo, sera necesario que se migre a 2048-bit.
2479
2480 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",unclassified,
2481 ,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.
2482 ","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).",unclassified,
2483 ,EN-Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales
2484 ","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",unclassified,
2485 ,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.
2486 ","If possible, you should set the Secure flag for this cookie.",low,
2487 ,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.
2488 ","If possible, you should set the HTTPOnly flag for this cookie.",low,
2489 ,EN-Apache httpd Remote Denial of Service,"* Alerta generada por el flag del servidor: ver: 2.2.15 *
2490 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.
2491 ",Actualizar version de apache,unclassified,
2492 ,EN-Robots.txt,"Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.
2493 ","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)
2494 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
2495 Disallow: /*AB/$
2496 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.",unclassified,
2497 ,EN-Typical Login Web,"Archivo de Login nombrado de manera ""comun"".
2498 ",Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,unclassified,
2499 ,EN-Credentials in Plain Text,"La pagina de login viaja sobre texto plano
2500 ",Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),medium,
2501 ,EN-Unencrypted __VIEWSTATE parameter,"El parametro ""__VIEWSTATE"" no esta encriptado. Para reducir las posibilidades que alguien intercepte informacion guardada en ViewState es bueno encriptarlo.
2502 ","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>
2503 <machineKey validation=""3DES""/>",unclassified,
2504 ,EN-Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
2505
2506 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
2507 style=""border-width:0px;"" />
2508
2509 Siendo la respuesta THHvB
2510
2511 Facilitando la manera de automatizar un script para atacar el form
2512 ",Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,unclassified,
2513 ,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.
2514
2515 The error messages may disclose sensitive information. This information can be used to launch further attacks.
2516 ",Review the source code for this script. The application need to show generic errors.,unclassified,
2517 ,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.
2518 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php
2519 ",Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,unclassified,
2520 ,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.
2521 ","You should include the attribute Autocomplete OFF:
2522 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",low,
2523 ,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
2524 ","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.",unclassified,
2525 ,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.
2526 ",,unclassified,
2527 ,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.
2528 ",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,
2529 ,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
2530 ","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,
2531 ,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.
2532 The OPTIONS method may expose sensitive information that may help an malicious user to prepare more advanced attacks.
2533 ",It's recommended to disable OPTIONS Method on the web server.,low,
2534 ,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.
2535 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.
2536 ",http://www.g-sec.lu/practicaltls.pdf,unclassified,
2537 ,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.
2538 ",,unclassified,
2539 ,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.
2540 ","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.
2541
2542 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.",unclassified,
2543 ,EN-User Credentials Sent in Clear Text,"Vulnerability description
2544 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.
2545
2546 The impact of this vulnerability
2547 A third party may be able to read the user credentials by intercepting an unencrypted HTTP connection.
2548 ","Because user credentials are considered sensitive information, should always be transferred to the server over an encrypted connection (HTTPS).",unclassified,
2549 ,EN-URL Redirection,"This script is possibly vulnerable to URL redirection attacks.
2550
2551 URL redirection is sometimes used as a part of phishing attacks that confuse visitors about which web site they are visiting.
2552
2553 The impact of this vulnerability
2554 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.
2555 ",Your script should properly sanitize user input.,unclassified,
2556 ,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.
2557 ",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.,unclassified,
2558 ,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.
2559
2560 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.
2561
2562 An attacker may execute arbitrary SQL statements on the vulnerable system. This may compromise the integrity of your database and/or expose sensitive information.
2563
2564 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.
2565
2566 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.
2567 ","Your script should filter metacharacters from user input.
2568 Check detailed information for more information about fixing this vulnerability.
2569 Detailed information",unclassified,
2570 ,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.
2571 ","It may be possible to disclose sensitive information about the web sever the ASP.NET application.
2572 More information on how to fix it:
2573 http://support.microsoft.com/default.aspx?scid=kb;en-us;815157",unclassified,
2574 ,EN-Unicode tranformation Issues,"This page is vulnerable to various Unicode transformation issues such as Best-Fit Mappings, Overlong byte sequences, Ill-formed sequences.
2575 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.
2576
2577 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:
2578 0xC0 0x8A
2579 0xE0 0x80 0x8A
2580 0xF0 0x80 0x80 0x8A
2581 0xF8 0x80 0x80 0x80 0x8A
2582 0xFC 0x80 0x80 0x80 0x80 0x8A
2583
2584 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.
2585
2586
2587 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.
2588 ","Identiy the source of these Unicode transformation issues and fix them. Consult the web references bellow for more information.
2589 Links with more information:
2590 http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf
2591 http://www.cl.cam.ac.uk/~mgk25/unicode.html
2592 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
2593 http://www.unicode.org/reports/tr36/",unclassified,
2594 ,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.
2595
2596 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.
2597 ","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.
2598
2599 https://www.owasp.org/index.php/Unrestricted_File_Upload
2600 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",unclassified,
2601 ,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.
2602
2603 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.
2604 ",Consult the virtual host configuration and check if this virtual host should be publicly accessible,unclassified,
2605 ,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.
2606 Developers often resort to the exceedingly untrustworthy HTTP Host header (_SERVER[""HTTP_HOST""] in PHP).
2607 Even otherwise-secure applications trust this value enough to write it to the page without HTML-encoding it with code equivalent to:
2608
2609 <link href=""http://_SERVER['HOST']"" (Joomla)
2610 ...and append secret keys and tokens to links containing it:
2611
2612 <a href=""http://_SERVER['HOST']?token=topsecret""> (Django, Gallery, others)
2613 ....and even directly import scripts from it:
2614
2615 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)
2616
2617 Host header *********evilhostDx5oMrAd.com was reflected inside a A tag (href attribute).
2618 ","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.",unclassified,
2619 ,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.
2620 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.
2621 ","Update to the latest version of jQuery.
2622 More info: http://ma.la/jquery_xss/
2623 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",unclassified,
2624 ,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.
2625
2626 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.
2627
2628 The scanner tested 10 invalid credentials and no account lockout was detected.
2629 ","It's recommended to implement some type of account lockout after a defined number of incorrect password attempts.
2630 More info:
2631 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",unclassified,
2632 ,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.
2633 ","If you are using Apache, you can setup a custom 404 page by following the instructions provided in the References section.",unclassified,
2634 ,EN-SSL weak ciphers,"The remote host supports the use of SSL ciphers that offer either weak encryption or no encryption at all.
2635 This vulnerability affects Server.
2636 ",Reconfigure the affected application to avoid use of weak ciphers.,unclassified,
2637 ,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.
2638
2639 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.
2640
2641 An attacker can perform session hijacking on an authenticated web session, allowing the launching of further attacks.
2642 ","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.
2643
2644 Web references
2645 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
2646 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",unclassified,
2647 ,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.
2648 Impact: Possible information disclosure.
2649 ",The form target should point to a secure (https) page.,unclassified,
2650 ,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.
2651
2652 Attackers may abuse HTTP TRACE functionality to gain access to information in HTTP headers such as cookies and authentication data.
2653 ","Disable TRACE Method on the web server.
2654
2655 Web references
2656 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
2657 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",unclassified,
2658 ,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
2659 ","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.
2660
2661 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",unclassified,
2662 ,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).
2663 ","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).",unclassified,
2664 ,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
2665 ",,high,
2666 ,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.
2667 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.
2668 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,
2669 ,ES-Credenciales Repetidas,"Existen multiples credeciales repetidas para un mismo acceso.
2670 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,
2671 ,ES-Ftp Anonimo,"Es servicio de FTP posee el usuario : anonymous
2672 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.
2673
2674 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,
2675 ,ES-Credenciales débiles Tomcat,"Se detectaron credenciales por defecto en servidores Tomcat, ejecutándose con privilegios elevados.
2676 Un atacante que intente loguearse con una lista de usuarios por defecto podría comprometer el servicio.
2677 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.
2678 ",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,
2679 ,ES-Wpad Spoofing,"En los ambientes Windows ante una falla a resolver un nombre de host,
2680 realizan una segunda búsqueda utilizando NetBios. La naturaleza de este
2681 pedido realizado utilizando broadcast es inseguro si no se tienen
2682 recaudos.
2683
2684 Un atacante podría utilizar esta vulnerabilidad para
2685 registrar el dominio WPAD en netbios con el fin de redirigir y modificar
2686 el tráfico de las workstations con las que comparte el segmento de red.
2687 Este ataque podría derivar en la captura de credenciales o hashes que
2688 le brinden acceso a sistemas críticos.
2689 ","Deshabilitar la configuración automática de proxy en los equipos
2690 windows, y registrar el nombre de domino wpad, para que ningún equipo de
2691 la red pueda impersonarlo.",high,
2692 ,ES-Servicio de Telnet,"Las credenciales de usuario se transmiten sobre un canal sin cifrar (servicio telnet).
2693 Un atacante capaz de interceptar el tráfico entre los hosts y el usuario remoto, será capaz de obtener las credenciales utilizadas.
2694 ","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,
2695 ,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.
2696 ","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:
2697 > 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.
2698 > Ejecutar aquellas tareas que requieran mayores privilegios utilizando la aplicación “RunAs”.
2699 > 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.
2700 > Asegurarse que las cuentas administrativas de ambientes de desarrollo y test sean diferentes a las de los sistemas críticos de producción.
2701 > Ejecutar los servicios necesarios para el correcto funcionamiento de la unidad de negocio en un equipo diferente al Controlador de Dominio.
2702 > 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).
2703
2704 Referencias:
2705 http://carnal0wnage.attackresearch.com/2008/05/token-passing-with-incognito-part-2.html
2706 http://pentestmonkey.net/uncategorized/from-local-admin-to-domain-admin
2707 http://www.offensive-security.com/metasploit-unleashed/Fun_With_Incognito",high,
2708 ,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
2709 ",La forma de prevenirlo: https://www.owasp.org/index.php/Denial_of_Service,high,
2710 ,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.
2711 ","Determinar si esta información debería ser accesible desde la red, sin estar protegida por credenciales.",medium,
2712 ,ES-Sitio sin Informar,"
2713 ",/reclamaciones/home/index. ,unclassified,
2714 ,ES-Listado de Directorios,"Muestra directorios que no deberian ser publicos
2715 ",Evitar que dichos directorios sean publicos,medium,
2716 ,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.
2717 ","Evitar entradas que posibiliten subir imagenes o codigo al servidor, sin ser adecuadamente controlado",unclassified,
2718 ,ES-Path Disclosure,"Permite ver la ruta a archivos u aplicaciones que no deberian ser mostradas
2719 ","Puede solucionarse desactivando los mensajes de error :
2720 En PHP modificando el archivo php.ini ( display_errors = 'off' )
2721 En Apache modificando el archivo httpd.conf ( php_flag display_errors off)",unclassified,
2722 ,ES-File Upload,"Es posible subir código o imagenes sin ser fitradas adecuadamente.
2723 ",Evitar campos para subir archivos que no sean correctamente filtrados,unclassified,
2724 ,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.
2725 ","Evitar que el metodo PUT se encuentre con libre acceso a cualquier tipo de usuario, restringir acceso.",unclassified,
2726 ,ES-Leer Archivos (Read files),"
2727 ",,unclassified,
2728 ,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.
2729 ",Cambiar usuarios y contraseñas de acuerdo a las politicas de la empresa,unclassified,
2730 ,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.
2731 ","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,
2732 ,ES-Enumerar Usuarios,"
2733 ",,medium,
2734 ,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
2735 ",Utilizar HTTPS para autenticar usuarios,medium,
2736 ,ES-Falta de Control de Acceso,"Se puede acceder a parte del sitio sin una sesion valida
2737 ",Validar correctamente la sesiones del sitio verifiquen que el usuario poseen una sesion valida,medium,
2738 ,ES-Cookie Reutilization,"La cookie puede ser modificada y reutilizada para hacer nuevas consultas o impersonar usuarios
2739 ",Evitar ,medium,
2740 ,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.
2741 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.
2742 ","Aplicar una política de seguridad al servidor que obligue el uso de contraseñas de acuerdo con las políticas de seguridad interna.
2743 Se recomienda un cifrado mas robusto con la funcion salt",high,
2744 ,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.
2745 ","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,
2746 ,ES-SSL weak ciphers (Cifrado debil),"El servidor remoto soporta el uso de SSL pero ofrece una encriptacion debil
2747 ",Reconfigurar el servidor web con un nivel de encriptacion mayor,medium,
2748 ,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
2749 ",Set to false debuging features in production releases,unclassified,
2750 ,EN-Flash Crossdomain policy,"The application publishes a Flash cross-domain policy which allows access from any domain.
2751 ",The policy must include the domains which are allowed by the Flash cross-domain policy,medium,
2752 ,EN-Session Token in URL,"The Session token is included in the URL. This could leak the session token
2753 ",Session tokens should only be included using safe channels,medium,
2754 ,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.
2755 ",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,
2756 ,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
2757 ",Siempre utilizar HTTPS para autenticar usuarios,high,
2758 ,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
2759 ","Recomendación actualizar y desactivar los mensajes de error del servidor, que puedan brindar información extra a un atacante",medium,
2760 ,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.
2761 ",Utilizar HTTPS en todo el sitio en donde la información sensible pueda ser expuesta.,high,
2762 ,ES-Server Version Discloure,"El servidor web responde con la version del sistema facilitando a un atacante saber contra que se enfrenta
2763 ","Filtrar en las respuestas del servidor, cualquier dato que demuestre la version del servidor y del sistema operativo del mismo",low,
2764 ,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).
2765
2766 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:
2767 <cross-domain-policy>
2768 <allow-access-from domain=""*"" />
2769 </cross-domain-policy>
2770 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.
2771
2772 Using an insecure cross-domain policy file could expose your site to various attacks.
2773 ","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.
2774 ",medium,
2775 ,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).
2776
2777 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:
2778 <cross-domain-policy>
2779 <allow-access-from domain=""*"" />
2780 </cross-domain-policy>
2781
2782 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.
2783 ","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.
2784 ",medium,
2785 ,EN-BREACH attack,"This web application is potentially vulnerable to the BREACH attack.
2786 An attacker with the ability to:
2787 Inject partial chosen plaintext into a victim's requests
2788 Measure the size of encrypted traffic
2789 can leverage information leaked by compression to recover targeted parts of the plaintext.
2790
2791 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:
2792
2793 Be served from a server that uses HTTP-level compression
2794 Reflect user-input in HTTP response bodies
2795 Reflect a secret (such as a CSRF token) in HTTP response bodies
2796
2797
2798 This alert was issued because the following conditions were met:
2799 The page content is served via HTTPS
2800 The server is using HTTP-level compression
2801 URL encoded GET input next was reflected into the HTTP response body.
2802 HTTP response body contains a secret named csrfmiddlewaretoken
2803 ","The mitigations are ordered by effectiveness (not by their practicality - as this may differ from one application to another).
2804
2805 Disabling HTTP compression
2806 Separating secrets from user input
2807 Randomizing secrets per request
2808 Masking secrets (effectively randomizing by XORing with a random secret per request)
2809 Protecting vulnerable pages with CSRF
2810 Length hiding (by adding random number of bytes to the responses)
2811 Rate-limiting the requests
2812
2813 More information http://breachattack.com/",unclassified,
2814 ,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.
2815 ","Es recomendable aplicar buenas politicas deprotección de información sensible, evitando exponer buckups y otra información del sitio web",high,
2816 ,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
2817 ",Siempre evitar que se puedan listar directorios de manera externa y sin permisos,high,
2818 ,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.
2819
2820 ",Evitar exponer toda información sensible del sistema,high,
2821 ,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
2822 ",Evitar exponer toda información sensible y privada del sistemadel sistema,low,
2823 ,ES-Archivos e información de desarollo en ambientes productivos,"Podemos ver código de programacion, con ejemplos concretos del funcionamiento interno y
2824 de la lógica utilizada a la hora de programar, dejando en evidencia
2825 informacion como nombres de usuarios, email, dni, telefonos, etc
2826 ",Evitar exponer toda información sensible y privada del sistemadel sistema,high,
2827 ,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
2828 ","Utilizar para la sentencia de SQL Prepared Statement
2829 Reference:
2830 https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet#Prepared_Statement_Examples",high,
2831 ,ES-Mysql lectura y escritura de archivos,"Es posible utilizar mysql server para la lectura y escritura de archivos en el servidor
2832 ","Seguir los siguientes lineamientos para el hardening de Mysql Server
2833 https://www.owasp.org/index.php/Testing_for_MySQL#Read_from_a_File",high,
2834 ,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.
2835 ","Eliminar el contenido de desarrollo, dejar solo lo necesario para el entorno productivo",high,
2836 ,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.
2837 ",Prevent this information from being displayed to the user,low,
2838 ,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.
2839 ",Se recomienda prevenir que esta informacion sea mostrada al usuario,low,
2840 ,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.
2841 ",Set the Page.EnableViewStateMac property to true on any pages where the ViewState is not currently signed.,low,
2842 ,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.
2843 ",Actualizar a la ultima version del firmware del CISCO ASA,high,
2844 ,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.
2845 ","Evitar listar directorios, es recomendable que se desabiliten o se resguarden con algun tipo de autenticacion.",low,
2846 ,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.
2847 Esta vulnerabilidad afecta Server.
2848 ",Vuelva a configurar la aplicacion afectada para evitar el uso de cifrados debiles.,medium,
0 # Minimal makefile for Sphinx documentation
1 #
2
3 # You can set these variables from the command line.
4 SPHINXOPTS =
5 SPHINXBUILD = python -msphinx
6 SPHINXPROJ = Faraday
7 SOURCEDIR = .
8 BUILDDIR = _build
9
10 # Put it first so that "make" without argument is like "make help".
11 help:
12 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13
14 .PHONY: help Makefile
15
16 # Catch-all target: route all unknown targets to Sphinx using the new
17 # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18 %: Makefile
19 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
0 # -*- coding: utf-8 -*-
1 #
2 # Faraday documentation build configuration file, created by
3 # sphinx-quickstart on Tue Oct 31 19:10:26 2017.
4 #
5 # This file is execfile()d with the current directory set to its
6 # containing dir.
7 #
8 # Note that not all possible configuration values are present in this
9 # autogenerated file.
10 #
11 # All configuration values have a default; values that are commented out
12 # serve to show the default.
13
14 # If extensions (or modules to document with autodoc) are in another directory,
15 # add these directories to sys.path here. If the directory is relative to the
16 # documentation root, use os.path.abspath to make it absolute, like shown here.
17 #
18 import os
19 import sys
20 sys.path.insert(0, os.path.abspath('..'))
21
22
23 # -- General configuration ------------------------------------------------
24
25 # If your documentation needs a minimal Sphinx version, state it here.
26 #
27 # needs_sphinx = '1.0'
28
29 # Add any Sphinx extension module names here, as strings. They can be
30 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31 # ones.
32 extensions = ['sphinx.ext.autodoc',
33 'sphinx.ext.viewcode']
34
35 # Add any paths that contain templates here, relative to this directory.
36 templates_path = ['_templates']
37
38 # The suffix(es) of source filenames.
39 # You can specify multiple suffix as a list of string:
40 #
41 # source_suffix = ['.rst', '.md']
42 source_suffix = '.rst'
43
44 # The master toctree document.
45 master_doc = 'index'
46
47 # General information about the project.
48 project = u'Faraday'
49 copyright = u'2017, Daniel Foguelman, Esteban Guillardoy, Ezequiel Tavella, Facundo de Guzmán, Federico Kirschbaum, Francisco Amato, Franco Linares, German Riera, Joaquín López Pereyra, Leonardo Lazzaro, Martín Rocha, Matias Ariel Ré Medina, Matias Lang, Micaela Ranea Sánchez, Sebastian Kulesz'
50 author = u'Daniel Foguelman, Esteban Guillardoy, Ezequiel Tavella, Facundo de Guzmán, Federico Kirschbaum, Francisco Amato, Franco Linares, German Riera, Joaquín López Pereyra, Leonardo Lazzaro, Martín Rocha, Matias Ariel Ré Medina, Matias Lang, Micaela Ranea Sánchez, Sebastian Kulesz'
51
52 # The version info for the project you're documenting, acts as replacement for
53 # |version| and |release|, also used in various other places throughout the
54 # built documents.
55 #
56 # The short X.Y version.
57 version = u'3.0.0'
58 # The full version, including alpha/beta/rc tags.
59 release = u'3.0.0'
60
61 # The language for content autogenerated by Sphinx. Refer to documentation
62 # for a list of supported languages.
63 #
64 # This is also used if you do content translation via gettext catalogs.
65 # Usually you set "language" from the command line for these cases.
66 language = None
67
68 # List of patterns, relative to source directory, that match files and
69 # directories to ignore when looking for source files.
70 # This patterns also effect to html_static_path and html_extra_path
71 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
72
73 # The name of the Pygments (syntax highlighting) style to use.
74 pygments_style = 'sphinx'
75
76 # If true, `todo` and `todoList` produce output, else they produce nothing.
77 todo_include_todos = False
78
79
80 # -- Options for HTML output ----------------------------------------------
81
82 # The theme to use for HTML and HTML Help pages. See the documentation for
83 # a list of builtin themes.
84 #
85 html_theme = 'alabaster'
86
87 # Theme options are theme-specific and customize the look and feel of a theme
88 # further. For a list of options available for each theme, see the
89 # documentation.
90 #
91 # html_theme_options = {}
92
93 # Add any paths that contain custom static files (such as style sheets) here,
94 # relative to this directory. They are copied after the builtin static files,
95 # so a file named "default.css" will overwrite the builtin "default.css".
96 html_static_path = ['_static']
97
98 # Custom sidebar templates, must be a dictionary that maps document names
99 # to template names.
100 #
101 # This is required for the alabaster theme
102 # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
103 html_sidebars = {
104 '**': [
105 'about.html',
106 'navigation.html',
107 'relations.html', # needs 'show_related': True theme option to display
108 'searchbox.html',
109 'donate.html',
110 ]
111 }
112
113
114 # -- Options for HTMLHelp output ------------------------------------------
115
116 # Output file base name for HTML help builder.
117 htmlhelp_basename = 'Faradaydoc'
118
119
120 # -- Options for LaTeX output ---------------------------------------------
121
122 latex_elements = {
123 # The paper size ('letterpaper' or 'a4paper').
124 #
125 # 'papersize': 'letterpaper',
126
127 # The font size ('10pt', '11pt' or '12pt').
128 #
129 # 'pointsize': '10pt',
130
131 # Additional stuff for the LaTeX preamble.
132 #
133 # 'preamble': '',
134
135 # Latex figure (float) alignment
136 #
137 # 'figure_align': 'htbp',
138 }
139
140 # Grouping the document tree into LaTeX files. List of tuples
141 # (source start file, target name, title,
142 # author, documentclass [howto, manual, or own class]).
143 latex_documents = [
144 (master_doc, 'Faraday.tex', u'Faraday Documentation',
145 u'Daniel Foguelman, Esteban Guillardoy, Ezequiel Tavella, Facundo de Guzmán, Federico Kirschbaum, Francisco Amato, Franco Linares, German Riera, Joaquín López Pereyra, Leonardo Lazzaro, Martín Rocha, Matias Ariel Ré Medina, Matias Lang, Micaela Ranea Sánchez, Sebastian Kulesz', 'manual'),
146 ]
147
148
149 # -- Options for manual page output ---------------------------------------
150
151 # One entry per manual page. List of tuples
152 # (source start file, name, description, authors, manual section).
153 man_pages = [
154 (master_doc, 'faraday', u'Faraday Documentation',
155 [author], 1)
156 ]
157
158
159 # -- Options for Texinfo output -------------------------------------------
160
161 # Grouping the document tree into Texinfo files. List of tuples
162 # (source start file, target name, title, author,
163 # dir menu entry, description, category)
164 texinfo_documents = [
165 (master_doc, 'Faraday', u'Faraday Documentation',
166 author, 'Faraday', 'One line description of project.',
167 'Miscellaneous'),
168 ]
169
170
171
0 Creating simple views
1 =====================
2
3 The following page is a quick-start to our REST API framework. It allows you
4 create CRUD API Endpoints without so many boilerplate, repeated code. Its
5 class based-style of doing things, inspired in `Django Rest Framework`_, lets
6 you make fully functional endpoints with a few lines of code and customize
7 them based on your needs.
8
9 .. _`Django REST Framework`: http://django-rest-framework.org/
10
11 The first thing you will need is a working SQLAlchemy model. Based on wether
12 that model will be available on only one workspace (like the majority of our
13 models) or in all the workspaces (like vuln templates or licenses) the things
14 are a bit different.
15
16
17 Workspaced views
18 ----------------
19
20 This are the most used in Faraday. Use it when you want a generic endpoint that
21 automatically performs the required workspace restrictions.
22
23 .. warning :: The base class of workspaced views does a good job preventing
24 objects of one workspace showing in another one, but it won't
25 do magic. If you are overriding or writing new methods ensure
26 you always think on an object's workspace.
27
28 Lets take for example a fragment of the services API code (some parts were
29 omitted because they are not important right now)::
30
31 from server.api.base import AutoSchema, ReadWriteWorkspacedView
32 from server.models import Service
33
34 class ServiceSchema(AutoSchema):
35
36 class Meta:
37 model = Service
38 fields = ("name", "description", "owned")
39
40 services_api = Blueprint('services_api', __name__)
41
42 class ServiceView(ReadWriteWorkspacedView):
43 route_base = 'services'
44 model_class = Service
45 schema_class = ServiceSchema
46
47 ServiceView.register(services_api)
48
49 This registers our service endpoint in a `Flask blueprint`_ named
50 ``services_api``. Then, the blueprint should be registered in the main
51 app in the ``server/app.py`` file::
52
53 def register_blueprints(app):
54 # ...
55 from server.api.modules.services import services_api
56 # ...
57 app.register_blueprint(services_api)
58 # ...
59
60
61 That is the code of the view. It will have list, detail, create, update, remove
62 and count endpoints, and all of them will be functional. If you want to only
63 enable some of them you should inherit from ``GenericWorkspacedView`` and from
64 some mixins that implement each method's behavior.
65
66 If you look at the view's code, the only thing it does is to define three
67 atrributes: ``route_base``, to define what is going on the URL, the class of
68 the model that the endpoint controls, and a Marshmallow schema defining the
69 serialization and deserialization proccess (this will be covered later). The
70 following endpoints will be generated:
71
72 * GET /_api/ws/<workspace_name>/services/ (list all the services)
73 * GET /_api/ws/<workspace_name>/services/count/ (count services)
74 * GET /_api/ws/<workspace_name>/services/<object_id>/ (get the info of some service)
75 * POST /_api/ws/<workspace_name>/services/ (create a service)
76 * PUT /_api/ws/<workspace_name>/services/<object_id>/ (update a service)
77 * DELETE /_api/ws/<workspace_name>/services/<object_id>/ (delete a service)
78
79
80 .. _`Flask blueprint`: http://flask.pocoo.org/docs/0.12/blueprints/
81
82 Non-workspaced views
83 --------------------
84
0 .. Faraday documentation master file, created by
1 sphinx-quickstart on Tue Oct 31 19:10:26 2017.
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 .. toctree::
9 :maxdepth: 3
10 :caption: Contents:
11
12 overview
13 creating_views
14 recipes
15 reference
16
17 Indices and tables
18 ==================
19
20 * :ref:`genindex`
21 * :ref:`modindex`
22 * :ref:`search`
0 ========
1 Overview
2 ========
3
4 This is the developer documentation of the Faraday server. If you are a user
5 instead, you should go to the `Faraday Wiki at GitHub
6 <https://github.com/infobyte/faraday/wiki>`_.
7
8 The Faraday server ecosystem
9 ----------------------------
10 We are using the following Python libraries to keep our server running:
11
12 `Flask`_
13 ^^^^^^^^
14
15 A minimalistic web framework for Python with a great (but a bit messy)
16 ecosystem.
17
18 `SQLAlchemy`_
19 ^^^^^^^^^^^^^
20
21 A really powerful but complex Object Relational Mapper for Python that allows
22 us to map results of SQL queries to instances of Python objects. Sometimes it
23 looks made by Java developers rather than Python devs.
24
25 `Flask-Classful`_
26 ^^^^^^^^^^^^^^^^^
27
28 A pretty simple library to create RESTful API endpoints inside a class defining
29 one or many routes related to that endpoint. Is takes the idea of Flask
30 `Pluggable Views`_.
31
32 The library is a fork of `Flask-Classy`_, a library that stopped being
33 maintained 4 years ago.
34
35 `Marshmallow`_
36 ^^^^^^^^^^^^^^
37
38 Framework-agnostic serialization and deserialization library to define the
39 input and output schema of our RESTful API in a declarative, pythonic web. It
40 is heavily inspired on `Django REST Framework serializers`_, but with the goal
41 of supporting many frameworks and ORMs
42
43 `Flask-Security`_
44 ^^^^^^^^^^^^^^^^^
45
46 A library prodiving a users and role system with support with Flask and SQLAlchemy.
47 It gives us customizable registration and login endpoints.
48
49 It was build on top of other common Flask libraries such as:
50
51 * `Flask-Login`_
52
53 .. _`Flask-Login`: https://flask-login.readthedocs.io/en/latest/
54
55 * `Flask-Principal`_
56
57 .. _`Flask-Principal`: https://pythonhosted.org/Flask-Principal/
58
59 .. _flask: http://flask.pocoo.org/
60 .. _Pluggable Views: http://flask.pocoo.org/docs/0.12/views/
61 .. _Flask-Classful: https://github.com/teracyhq/flask-classful
62 .. _Flask-Classy: https://github.com/apiguy/flask-classy
63 .. _SQLAlchemy: https://www.sqlalchemy.org/
64 .. _Marshmallow: http://marshmallow.readthedocs.io/en/latest/
65 .. _Django Rest Framework serializers: http://www.django-rest-framework.org/api-guide/serializers/
66 .. _Flask-Security: https://flask-security.readthedocs.io/en/latest/
67
68 Other libraries we use
69 ^^^^^^^^^^^^^^^^^^^^^^
70
71 * `Marshmallow-SQLAlchemy`_ To automatically create Marshmallow schemas based
72 on SQLAlchemy models
73
74 .. _`Marshmallow-SQLAlchemy`: https://marshmallow-sqlalchemy.readthedocs.io/
75
76 * `Flask-SQLAlchemy`_ provides us a nice way to use the framework and the ORM together.
77 It also has a good `pagination system` that is used on many API endpoints
78
79 .. _`Flask-SQLAlchemy`: http://flask-sqlalchemy.pocoo.org/
80 .. _pagination system: http://flask-sqlalchemy.pocoo.org/2.3/api/#utilities
81
82 * `Webargs`_ to parse the request arguments given a Marshmallow Schema
83
84 .. _`Webargs`: http://webargs.readthedocs.io/
85
86 * `Filteralchemy`_ to make query filters in a declarative way, inspired on
87 `django-filter`_
88
89 .. note::
90 This library is unmantained, so we have our own fork of it hosted on
91 https://github.com/infobyte/filteralchemy
92
93 .. _`django-filter`: https://github.com/carltongibson/django-filter
94 .. _`Filteralchemy`: http://filteralchemy.readthedocs.io/
95
96 * `Depot`_ to have pluggable file storage backends
97
98 .. _`Depot`: http://depot.readthedocs.io/
0 ====================
1 Extending your views
2 ====================
3
4 This will cover common recipes used to make more advanced views.
5
6 *****************************
7 Customizing the list endpoint
8 *****************************
9
10 .. _pagination-and-sorting-recipe:
11
12 Enabling pagination and sorting
13 ===============================
14
15 By default all views inherit from ``SortableMixin`` so they allow the user to
16 set the order field with the ``sort`` GET parameter, and the direction with the
17 ``sort_dir`` parameter (it's value should be either "asc" or "desc").
18
19 To define the default field that will be used if this parameter is not set, you
20 should set the `order_field` attribute of your class. For example, the Hosts
21 view uses the IP field to sort the returned data by default::
22
23 class HostsView(PaginatedMixin,
24 FilterAlchemyMixin,
25 ReadWriteWorkspacedView):
26 route_base = 'hosts'
27 model_class = Host
28 order_field = Host.ip.asc()
29 # ...
30
31 Note that you have to indicate both the field and the direction, like in the
32 example.
33
34 If you want to enable pagination you should explicitly inherit from
35 ``PaginatedMixin``. Then, when the users specify both ``page`` and
36 ``page_number`` GET parameters the view will paginate the results.
37
38 By default it won't show the pagination metadata (like the total number of
39 pages or elements), so you will have to follow the steps below to do it.
40
41 .. _envelope-list-example:
42
43 Changing returned JSON format
44 =============================
45
46 Since the new views were designed to fit the Web UI, the format of the
47 list endpoints of different models should be distinct in some cases.
48
49 To do this, you can override the ``_envelope_list`` method of your view. It
50 takes a list of serialized objects and a None-able ``pagination_metadata``
51 object with details of the pagination. If you don't use pagination, you won't
52 have to worry about this last one. In the case you are inheriting from
53 ``PaginatedMixin``, it will be an instance of `flask_sqlalchemy.Pagination`_.
54
55 For example, lets see the code of the vulns API::
56
57 class VulnerabilityView(PaginatedMixin,
58 FilterAlchemyMixin,
59 ReadWriteWorkspacedView):
60 # ...
61 def _envelope_list(self, objects, pagination_metadata=None):
62 vulns = []
63 for vuln in objects:
64 vulns.append({
65 'id': vuln['_id'],
66 'key': vuln['_id'],
67 'value': vuln
68 })
69 return {
70 'vulnerabilities': vulns,
71 'count': (pagination_metadata.total
72 if pagination_metadata is not None else len(vulns))
73 }
74
75 .. warning::
76 Ensure that you correctly handle the case of ``pagination_metadata`` being
77 None. This happens when the user doesn't specify the page number or size, so
78 all the objects will be shown.
79
80
81 .. _`flask_sqlalchemy.Pagination`: http://flask-sqlalchemy.pocoo.org/2.3/api/#utilities
82
83 Adding filters
84 ==============
85
86 If you want to enable the API clients to filter by a specific field, you should
87 inherit from the ``FilterAlchemyMixin`` (this isn't done by default like with
88 ``SortableMixin``). Then you define a ``filterset_class`` attribute in your
89 class indicating the `filteralchemy filterset`_ to use::
90
91 from filteralchemy import FilterSet, operators
92
93 class HostFilterSet(FilterSet):
94 class Meta(FilterSetMeta):
95 model = Host
96 fields = ('os',)
97 operators = (operators.Equal, operators.Like, operators.ILike)
98
99 class HostsView(PaginatedMixin,
100 FilterAlchemyMixin,
101 ReadWriteWorkspacedView):
102 route_base = 'hosts'
103 model_class = Host
104 filterset_class = HostFilterSet
105
106 .. _`filteralchemy filterset`: http://filteralchemy.readthedocs.io/en/latest/quickstart.html
107
108 Then the user will be able to use GET parameters like ``os`` (exact match)
109 and ``os__like`` (SQL like) to filter the query.
110
111 **********************************************
112 Trigerring some actions when creating/updating
113 **********************************************
114
115 ***********************************************
116 Using different schemas depending on the method
117 ***********************************************
0 API Reference
1 =============
2
3 Generic views
4 -------------
5
6 Use this ones to expose API endpoints that don't depend of a workspace, such as
7 users, vuln templates, or the workspaces API itself
8
9 .. autoclass:: server.api.base.GenericView
10 :members: model_class,schema_class,route_prefix,base_args,representations,
11 lookup_field,lookup_field_type,get_joinedloads, get_undefer,
12 _get_schema_class, _get_lookup_field, _validate_object_id,
13 _get_base_query, _get_eagerloaded_query, _filter_query,
14 _get_object, _dump, _parse_data, register
15
16 :private-members:
17
18 .. autoclass:: server.api.base.ListMixin
19 :members: _envelope_list,_get_order_field,_paginate
20
21 .. autoclass:: server.api.base.RetrieveMixin
22 .. autoclass:: server.api.base.SortableMixin
23 .. autoclass:: server.api.base.ReadOnlyView
24 .. autoclass:: server.api.base.CreateMixin
25 :members: _perform_create
26 .. autoclass:: server.api.base.UpdateMixin
27 :members: _update_object, _perform_update
28
29 .. autoclass:: server.api.base.DeleteMixin
30 .. autoclass:: server.api.base.ReadWriteView
31
32
33 Generic workspaced views
34 ------------------------
35
36 Use this type of views to make workspace-sensitive API endpoints. All views
37 created by this class need the user to specify a valid workspace name in the URL.
38
39 This is the most common type of views in Faraday.
40
41 .. autoclass:: server.api.base.GenericWorkspacedView
42 .. autoclass:: server.api.base.ListWorkspacedMixin
43 .. autoclass:: server.api.base.RetrieveWorkspacedMixin
44 .. autoclass:: server.api.base.ReadWriteWorkspacedView
45 .. autoclass:: server.api.base.CreateWorkspacedMixin
46 :members: _perform_create
47
48 .. autoclass:: server.api.base.UpdateWorkspacedMixin
49 :members: _update_object, _perform_update
50
51 .. autoclass:: server.api.base.DeleteWorkspacedMixin
52 .. autoclass:: server.api.base.CountWorkspacedMixin
53 .. autoclass:: server.api.base.ReadWriteWorkspacedView
77 import argparse
88 import subprocess
99
10 import sqlalchemy
11 from colorama import init, Fore
1210
1311 try:
12 from colorama import init, Fore
13 import sqlalchemy
1414 import server.config
1515 import server.couchdb
1616 import server.utils.logger
6161 server.config.gen_web_config()
6262
6363
64 def stop_server():
65 if not daemonize.stop_server():
64 def stop_server(port):
65 if not daemonize.stop_server(port):
6666 # Exists with an error if it couldn't close the server
6767 return False
6868 else:
69 logger.info("Faraday Server stopped successfully")
7069 return True
7170
7271
73 def is_server_running():
74 pid = daemonize.is_server_running()
72 def is_server_running(port):
73 pid = daemonize.is_server_running(port)
7574 if pid is not None:
7675 logger.warn("Faraday Server is already running. PID: {}".format(pid))
7776 return True
8382 import server.web
8483
8584 web_server = server.web.WebServer(enable_ssl=args.ssl)
86
87 daemonize.create_pid_file()
85 daemonize.create_pid_file(args.port)
8886 web_server.run()
8987
9088
9290 with app.app_context():
9391 try:
9492 if not db.session.query(Workspace).count():
95 logger.warn('No workspaces found. Remeber to execute couchdb importer')
93 logger.warn('No workspaces found. Remember to execute CouchDB importer')
94 except sqlalchemy.exc.ArgumentError:
95 logger.error(
96 '\n\b{RED}Please check your PostgreSQL connection string in the file ~/.faraday/config/server.ini on your home directory.{WHITE} \n'.format(RED=Fore.RED, WHITE=Fore.WHITE)
97 )
98 sys.exit(1)
9699 except sqlalchemy.exc.OperationalError:
97100 logger.error(
98 '\n\n{RED}Could not connect to postgresql.\n{WHITE}Please check: \n{YELLOW} * if database is running \n * configuration settings are correct. \n\n{WHITE}For first time installations execute{WHITE}: \n\n {GREEN} python manage.py initdb\n\n'.format(GREEN=Fore.GREEN, YELLOW=Fore.YELLOW, WHITE=Fore.WHITE, RED=Fore.RED))
101 '\n\n{RED}Could not connect to PostgreSQL.\n{WHITE}Please check: \n{YELLOW} * if database is running \n * configuration settings are correct. \n\n{WHITE}For first time installations execute{WHITE}: \n\n {GREEN} python manage.py initdb\n\n'.format(GREEN=Fore.GREEN, YELLOW=Fore.YELLOW, WHITE=Fore.WHITE, RED=Fore.RED))
99102 sys.exit(1)
100103
101104
125128 server.utils.logger.set_logging_level(server.config.DEBUG)
126129
127130 if args.stop:
128 sys.exit(0 if stop_server() else 1)
131 if args.port:
132 sys.exit(0 if stop_server(args.port) else 1)
133 else:
134 ports = daemonize.get_ports_running()
135 exit_code = 0
136 for port in ports:
137 exit_code += 0 if stop_server(port) else 1
138 sys.exit(exit_code)
139
140 else:
141 if not args.port:
142 args.port = 5985
129143
130144 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
131145 result = sock.connect_ex((args.bind_address or server.config.faraday_server.bind_address, int(args.port or server.config.faraday_server.port)))
132146
133 if is_server_running() and result == 0:
147 if is_server_running(args.port) and result == 0:
134148 sys.exit(1)
135149
136150 if result == 0:
137 logger.error("Faraday server port in use. Check your processes and run the server again...")
151 logger.error("Faraday Server port in use. Check your processes and run the server again...")
138152 sys.exit(1)
139153
140154 # Overwrites config option if SSL is set by argument
158172 # and without --start nor --stop
159173 devnull = open('/dev/null', 'w')
160174 params = ['/usr/bin/env', 'python2.7', os.path.join(server.config.FARADAY_BASE, __file__), '--no-setup']
161 if args.ssl:
162 params.append('--ssl')
163 if args.debug:
164 params.append('--debug')
175 arg_dict = vars(args)
176 for arg in arg_dict:
177 if arg not in ["start", "stop"] and arg_dict[arg]:
178 params.append('--'+arg)
179 if arg_dict[arg] != True:
180 params.append(arg_dict[arg])
165181 logger.info('Faraday Server is running as a daemon')
166182 subprocess.Popen(params, stdout=devnull, stderr=devnull)
167183 else:
0 #!/bin/zsh
0 #!/usr/bin/env zsh
11
22 ###
33 ## Faraday Penetration Test IDE
2525 export FARADAY_ZSH_HOST
2626 FARADAYZDOTDIR="$HOME/.faraday/zsh/"
2727 OLDZDOTDIR=$ZDOTDIR
28 ZDOTDIR=$FARADAYZDOTDIR /bin/zsh
28 ZDOTDIR=$FARADAYZDOTDIR /usr/bin/env zsh
2929
3030 #source ~/.faraday/zsh/.zshrc
00 #!/usr/bin/env python2.7
11 '''
22 Faraday Penetration Test IDE
3 Copyright (C) 2014 Infobyte LLC (http://www.infobytesec.com/)
3 Copyright (C) 2018 Infobyte LLC (http://www.infobytesec.com/)
44 See the file 'doc/LICENSE' for the license information
5
65 '''
76
87 import os
98 import sys
109 import shutil
10 import getpass
1111 import argparse
12 import requests.exceptions
1213
1314 from config.configuration import getInstanceConfiguration
1415 from config.globals import (
6970
7071
7172 def getParserArgs():
72 """Parser setup for faraday launcher arguments.
73
73 """
74 Parser setup for faraday launcher arguments.
7475 """
7576
7677 parser = argparse.ArgumentParser(
9192 dest="port_xmlrpc",
9293 default=None,
9394 type=int,
94 help="Sets the port where the api XMLRPCServer will listen. Default = 9876")
95 help="Sets the port where the API XMLRPC Server will listen. Default = 9876")
9596
9697 parser_connection.add_argument('-pr',
9798 '--port-rest',
99100 dest="port_rest",
100101 default=None,
101102 type=int,
102 help="Sets the port where the api RESTful server will listen. Default = 9977")
103 help="Sets the port where the API RESTful Server will listen. Default = 9977")
103104
104105 parser.add_argument('--disable-excepthook',
105106 action="store_true",
129130 action="store",
130131 dest="gui",
131132 default="gtk",
132 help="Select interface to start faraday. Supported values are gtk and 'no' (no GUI at all). Defaults to GTK")
133 help="Select interface to start Faraday. Supported values are 'gtk' and 'no' (no GUI at all). Defaults to GTK")
133134
134135 parser.add_argument('--cli',
135136 action="store_true",
136137 dest="cli",
137138 default=False,
138 help="Set this flag to avoid gui and use faraday as a cli.")
139 help="Set this flag to avoid GUI and use Faraday as a CLI.")
139140
140141 parser.add_argument('-w',
141142 '--workspace',
149150 action="store",
150151 dest="filename",
151152 default=None,
152 help="Report to be parsed by the cli")
153 help="Report to be parsed by the CLI")
153154
154155 parser.add_argument('-d',
155156 '--debug',
161162 action="store",
162163 dest="creds_file",
163164 default=None,
164 help="File containing user's credentials to be used in cli mode")
165 help="File containing user's credentials to be used in CLI mode")
165166
166167 parser.add_argument('--nodeps',
167168 action="store_true",
168169 help='Skip dependency check')
169 parser.add_argument('--keep-old', action='store_true', help='Keep old object in CLI mode if faraday find a conflict')
170 parser.add_argument('--keep-new', action='store_true', help='Keep new object in CLI mode if faraday find a conflict (DEFAULT ACTION)')
170 parser.add_argument('--keep-old', action='store_true', help='Keep old object in CLI mode if Faraday find a conflict')
171 parser.add_argument('--keep-new', action='store_true', help='Keep new object in CLI mode if Faraday find a conflict (DEFAULT ACTION)')
171172
172173 f = open(FARADAY_VERSION_FILE)
173174 f_version = f.read().strip()
175176 parser.add_argument('-v', '--version', action='version',
176177 version='Faraday v{version}'.format(version=f_version))
177178
178 # args = parser.parse_args(['@parser_args.cfg'])
179179 return parser.parse_args()
180180
181181
182182 def check_dependencies_or_exit():
183 """Dependency resolver based on a previously specified CONST_REQUIREMENTS_FILE.
184
183 """
184 Dependency resolver based on a previously specified CONST_REQUIREMENTS_FILE.
185185 Currently checks a list of dependencies from a file and exits if they are not met.
186
187186 """
188187
189188 installed_deps, missing_deps, conflict_deps = dependencies.check_dependencies(requirements_file=FARADAY_REQUIREMENTS_FILE)
209208 logger.info("Dependencies met")
210209
211210 def setConf():
212 """User configuration management and instantiation.
213
211 """
212 User configuration management and instantiation.
214213 Setting framework configuration based either on previously user saved
215214 settings or default ones.
216
217215 """
218216
219217 logger.info("Setting configuration.")
259257 start = main_app.start
260258
261259 from colorama import Fore, Back, Style
262 import string
263260 serverURL = getInstanceConfiguration().getServerURI()
264261 if serverURL:
265262 url = "%s/_ui" % serverURL
275272
276273
277274 def setupPlugins(dev_mode=False):
278 """Checks and handles Faraday's plugin status.
275 """
276 Checks and handles Faraday's plugin status.
279277
280278 When dev_mode is True, the user enters in development mode and the plugins
281279 will be replaced with the latest ones.
285283
286284 TODO: When dependencies are not satisfied ask user if he wants to try and
287285 run faraday with a inestability warning.
288
289286 """
290287
291288 if dev_mode:
302299
303300
304301 def setupZSH():
305 """Cheks and handles Faraday's integration with ZSH.
302 """
303 Checks and handles Faraday's integration with ZSH.
306304
307305 If the user has a .zshrc file, it gets copied and integrated with
308306 faraday's zsh plugin.
309
310307 """
311308
312309 if os.path.isfile(USER_ZSHRC):
324321
325322
326323 def setupXMLConfig():
327 """Checks user configuration file status.
324 """
325 Checks user configuration file status.
328326
329327 If there is no custom config the default one will be copied as a default.
330328 """
337335
338336
339337 def setupImages():
340 """ Copy png icons
338 """
339 Copy png icons
341340 """
342341 if os.path.exists(FARADAY_USER_IMAGES):
343342 shutil.rmtree(FARADAY_USER_IMAGES)
345344
346345
347346 def checkConfiguration(gui_type):
348 """Checks if the environment is ready to run Faraday.
347 """
348 Checks if the environment is ready to run Faraday.
349349
350350 Checks different environment requirements and sets them before starting
351351 Faraday. This includes checking for plugin folders, libraries,
363363
364364
365365 def setupFolders(folderlist):
366 """Checks if a list of folders exists and creates them otherwise.
367
366 """
367 Checks if a list of folders exists and creates them otherwise.
368368 """
369369
370370 for folder in folderlist:
373373
374374
375375 def checkFolder(folder):
376 """Checks whether a folder exists and creates it if it doesn't.
377
376 """
377 Checks whether a folder exists and creates it if it doesn't.
378378 """
379379
380380 if not os.path.isdir(folder):
384384
385385
386386 def printBanner():
387 """Prints Faraday's ascii banner.
388
387 """
388 Prints Faraday's ascii banner.
389389 """
390390 from colorama import Fore, Back, Style
391391 print (Fore.RED + """
428428 logger.info("No updates available, enjoy Faraday.")
429429
430430
431 def checkServerUrl():
432 import requests
433 CONF = getInstanceConfiguration()
434 server_url = CONF.getServerURI()
435
436 if server_url is None or CONF.getAPIUsername() is None or CONF.getAPIUsername() is None:
437 doLoginLoop()
438 server_url = CONF.getServerURI()
439
440 try:
441 requests.get(server_url, timeout=5)
442 except requests.exceptions.SSLError:
443 print("""
444 SSL certificate validation failed.
445 You can use the --cert option in Faraday
446 to set the path of the cert
447 """)
448 sys.exit(-1)
449 except requests.exceptions.MissingSchema as ex:
450 print("Check ~/.faraday/config/user.xml server url, the following error was found: {0} ".format(ex))
451
452
453431 def check_faraday_version():
454432 try:
455433 server.check_faraday_version()
456434 except RuntimeError:
457 getLogger("launcher").error("The server is running a different Faraday version than the client "
458 "you are running. Version numbers must match!")
459
435 getLogger("launcher").error(
436 "The server is running a different Faraday version than the client you are running. Version numbers must match!")
460437 sys.exit(2)
461438
462439
463 def doLoginLoop():
464 """ Sets the username and passwords from the command line.
465 If --login flag is set then username and password is set """
466
467 import getpass
468
469 print("""\nTo login please provide your valid DB Credentials.\n
470 You have 3 attempts.""")
471
440 def try_login_user(server_uri, api_username, api_password):
441
472442 try:
443 session_cookie = login_user(server_uri, api_username, api_password)
444 return session_cookie
445 except requests.exceptions.SSLError:
446 print("SSL certificate validation failed.\nYou can use the --cert option in Faraday to set the path of the cert")
447 sys.exit(-1)
448 except requests.exceptions.MissingSchema:
449 print("The Faraday Server URL is incorrect, please try again.")
450 sys.exit(-2)
451
452
453 def doLoginLoop(force_login=False):
454 """
455 Sets the username and passwords from the command line.
456 If --login flag is set then username and password is set
457 """
458
459 try:
473460
474461 CONF = getInstanceConfiguration()
475 server_url = CONF.getAPIUrl()
476 if server_url is None:
477 server_url = raw_input(
478 "Please enter the faraday server url (press enter for http://localhost:5985): ") or "http://localhost:5985"
479 CONF.setAPIUrl(server_url)
462 old_server_url = CONF.getAPIUrl()
463 api_username = CONF.getAPIUsername()
464 api_password = CONF.getAPIPassword()
465 if old_server_url and api_username and api_password and not force_login:
466 return
467
468 if old_server_url is None:
469 new_server_url = raw_input(
470 "\nPlease enter the Faraday Server URL (Press enter for http://localhost:5985): ") or "http://localhost:5985"
471 else:
472 new_server_url = raw_input(
473 "\nPlease enter the Faraday Server URL (Press enter for last used: {}): ".format(old_server_url)) or old_server_url
474
475 CONF.setAPIUrl(new_server_url)
476
477 print("""\nTo login please provide your valid Faraday credentials.\nYou have 3 attempts.""")
480478
481479 for attempt in range(1, 4):
482480
483 username = raw_input("Username (press enter for faraday): ") or "faraday"
484 password = getpass.getpass('Password: ')
485
486 session_cookie = login_user(server_url, username, password)
481 api_username = raw_input("Username (press enter for faraday): ") or "faraday"
482 api_password = getpass.getpass('Password: ')
483
484 session_cookie = try_login_user(new_server_url, api_username, api_password)
485
487486 if session_cookie:
488487
489 CONF.setAPIUsername(username)
490 CONF.setAPIPassword(password)
488 CONF.setAPIUsername(api_username)
489 CONF.setAPIPassword(api_password)
491490 CONF.setDBSessionCookies(session_cookie)
492491 CONF.saveConfig()
493492
494493 user_info = get_user_info()
495494 if (user_info is None) or (not user_info) or ('username' not in user_info):
496 print("You can't login as a client. You have %s attempt(s) left." % (3 - attempt))
495 print('Login failed, please try again. You have %d more attempts' % (3 - attempt))
497496 continue
498497
499 logger.info('Login successful')
500
498 logger.info('Login successful: {0}'.format(api_username))
501499 break
500
502501 print('Login failed, please try again. You have %d more attempts' % (3 - attempt))
503502
504503 else:
505504 logger.fatal('Invalid credentials, 3 attempts failed. Quitting Faraday...')
506505 sys.exit(-1)
506
507507 except KeyboardInterrupt:
508508 sys.exit(0)
509509
510510
511 def login(forced_login):
512
513 CONF = getInstanceConfiguration()
514 server_uri = CONF.getServerURI()
515 api_username = CONF.getAPIUsername()
516 api_password = CONF.getAPIPassword()
517
518 if forced_login:
519 doLoginLoop(forced_login)
520 return
521
522 if server_uri and api_username and api_password:
523
524 session_cookie = try_login_user(server_uri, api_username, api_password)
525
526 if session_cookie:
527 CONF.setDBSessionCookies(session_cookie)
528 logger.info('Login successful: {0}'.format(api_username))
529 return
530
531 doLoginLoop()
532
533
511534 def main():
512535 """
513536 Main function for launcher.
517540 global logger, args
518541
519542 logger = getLogger("launcher")
520
521543 args = getParserArgs()
522544 setupFolders(CONST_FARADAY_FOLDER_LIST)
523545 setUpLogger(args.debug)
524
525546 if not args.nodeps:
526547 check_dependencies_or_exit()
527
528548 printBanner()
529549 if args.cert_path:
530550 os.environ[REQUESTS_CA_BUNDLE_VAR] = args.cert_path
531551 checkConfiguration(args.gui)
532552 setConf()
533 checkServerUrl()
534 CONF = getInstanceConfiguration()
535 if args.login:
536 if not CONF.getServerURI():
537 couchURI = raw_input("Enter the Faraday server [http://127.0.0.1:5985]: ") or "http://127.0.0.1:5985"
538
539 if couchURI:
540 CONF.setAPIUrl(couchURI)
541 checkServerUrl()
542 else:
543 logger.fatal('Please configure Faraday server to authenticate (--login)')
544 sys.exit(-1)
545
546 doLoginLoop()
547 else:
548 session_cookie = login_user(CONF.getServerURI(), CONF.getAPIUsername(), CONF.getAPIPassword())
549 if session_cookie:
550 CONF.setDBSessionCookies(session_cookie)
551
553 login(args.login)
552554 check_faraday_version()
553555 checkUpdates()
554556 startFaraday()
3838 "check configuration.") % workspace)
3939 getLogger(self).error(
4040 "You may try and go to ~/.faraday/config/user.xml "
41 "to set a valid couch_uri and last_workspace")
41 "to set a valid api_uri and last_workspace")
4242 getLogger(self).error(str(e))
4343 return -1
4444 workspace = ws.name
2727 apt-get update
2828
2929 #Install community dependencies
30 for pkg in build-essential python-setuptools python-pip python-dev libpq-dev libffi-dev gir1.2-gtk-3.0 gir1.2-vte-2.91 python-gobject zsh curl python-psycopg2 ; do
30 for pkg in build-essential python-setuptools python-pip python-dev libpq-dev libffi-dev gir1.2-gtk-3.0 gir1.2-vte-2.91 python-gobject zsh curl python-psycopg2 postgresql; do
3131 apt-get install -y $pkg
3232 done
3333 fi
1717 from server.commands.faraday_schema_display import DatabaseSchema
1818 from server.commands.app_urls import show_all_urls
1919 from server.commands.reports import import_external_reports
20 from server.commands.status_check import full_status_check
20 from server.commands import status_check as status_check_functions
2121 from server.models import db, User
2222 from server.importer import ImportCouchDB
2323
101101 pgcli.run_cli()
102102
103103
104 @click.command(help="Check critical modules in Faraday server application")
105 def status_check():
106 full_status_check()
104 @click.command(help='Checks configuration and faraday status.')
105 @click.option('--check_postgresql', default=False, is_flag=True)
106 @click.option('--check_faraday', default=False, is_flag=True)
107 @click.option('--check_dependencies', default=False, is_flag=True)
108 @click.option('--check_config', default=False, is_flag=True)
109 def status_check(check_postgresql, check_faraday, check_dependencies, check_config):
107110
111 selected = False
112 exit_code = 0
113 if check_postgresql:
114 # exit_code is created for Faraday automation-testing purposes
115 exit_code = status_check_functions.print_postgresql_status()
116 status_check_functions.print_postgresql_locks_status()
117 selected = True
118
119 if check_faraday:
120 status_check_functions.print_faraday_status()
121 selected = True
122
123 if check_dependencies:
124 status_check_functions.print_depencencies_status()
125 selected = True
126
127 if check_config:
128 status_check_functions.print_config_status()
129 selected = True
130
131 if not selected:
132 status_check_functions.full_status_check()
133
134 sys.exit(exit_code)
108135
109136 def validate_user_unique_field(ctx, param, value):
110137 with app.app_context():
2626 import os
2727 import json
2828 import logging
29 from ConfigParser import SafeConfigParser
3029
3130 try:
3231 import urlparse
5655
5756 FARADAY_UP = True
5857 FARADAY_UPLOAD_REPORTS_WEB_COOKIE = None
58 FARADAY_UPLOAD_REPORTS_OVERWRITE_SERVER_URL = None
5959
6060 SERVER_URL = "http://127.0.0.1:5985"
6161 AUTH_USER = ""
9191
9292
9393 def _get_base_server_url():
94 if FARADAY_UPLOAD_REPORTS_WEB_COOKIE:
95 parser = SafeConfigParser()
96 parser.read(LOCAL_CONFIG_FILE)
97 server_url = 'http://{0}:{1}'.format(
98 parser.get('faraday_server', 'bind_address'),
99 parser.get('faraday_server', 'port'))
100 logger.info('Detected upload cookie. Using server_url as {0}'.format(server_url))
94
95 # Faraday server is running, and this module is used by upload_reports...
96 if FARADAY_UPLOAD_REPORTS_OVERWRITE_SERVER_URL:
97 server_url = FARADAY_UPLOAD_REPORTS_OVERWRITE_SERVER_URL
98 logger.info('Detected upload cookie Using server_url as {0}'.format(server_url))
10199 elif FARADAY_UP:
102100 server_url = _conf().getAPIUrl()
103101 logger.info('Detected faraday client running. Using server_url as {0}'.format(server_url))
192190
193191
194192 @_add_session_cookies
195 def _unsafe_io_with_server(server_io_function, server_expected_response,
193 def _unsafe_io_with_server(server_io_function, server_expected_responses,
196194 server_url, **payload):
197195 """A wrapper for functions which deals with I/O to or from the server.
198196 It calls the server_io_function with url server_url and the payload,
211209 raise ResourceDoesNotExist(server_url)
212210 if answer.status_code == 403 or answer.status_code == 401:
213211 raise Unauthorized(answer)
214 if answer.status_code != server_expected_response:
212 if answer.status_code not in server_expected_responses:
215213 raise requests.exceptions.RequestException(response=answer)
216214 except requests.exceptions.RequestException as ex:
217215 logger.debug(ex)
241239 Return a dictionary with the information in the json.
242240 """
243241 return _parse_json(_unsafe_io_with_server(requests.get,
244 200,
242 [200],
245243 request_url,
246244 params=params))
247245
259257 {u'id': u'61', u'ok': True, u'rev': u'1-967a00dff5e02add41819138abb3284d'}
260258 """
261259 return _parse_json(_unsafe_io_with_server(requests.put,
262 expected_response,
260 [expected_response],
263261 post_url,
264262 json=params))
265263
266264
267265 def _post(post_url, update=False, expected_response=201, **params):
268266 return _parse_json(_unsafe_io_with_server(requests.post,
269 expected_response,
267 [expected_response],
270268 post_url,
271269 json=params))
272270
279277 last_rev = _get(delete_url)['_rev']
280278 params = {'rev': last_rev}
281279 return _parse_json(_unsafe_io_with_server(requests.delete,
282 200,
280 [200,204],
283281 delete_url,
284282 params=params))
285283
595593 A dictionary with the object's information.
596594 """
597595 get_url = _create_couch_get_url(workspace_name, object_id)
598 response = _unsafe_io_with_server(requests.get, 200, get_url,
596 response = _unsafe_io_with_server(requests.get, [200], get_url,
599597 params={'revs': 'true', 'open_revs': 'all'})
600598 try:
601599 valid_json_response = _clean_up_stupid_couch_response(response.text)
3333
3434 from config.configuration import getInstanceConfiguration
3535 CONF = getInstanceConfiguration()
36 VERSION = server.config.__get_version().split('+')[0]
36 VERSION = server.config.__get_version().split('-')[0].split('rc')[0]
3737 logger = logging.getLogger(__name__)
3838
3939
255255 self.__addPendingAction(Modelactions.ADDSERVICEHOST, serv_obj)
256256 return serv_obj.getID()
257257
258 def createAndAddVulnToHost(self, host_id, name, desc="", ref=[],
258 def createAndAddVulnToHost(self, host_id, name, data="", desc="", ref=[],
259259 severity="", resolution=""):
260260
261261 vuln_obj = model.common.factory.createModelObject(
262262 Vuln.class_signature,
263 name, desc=desc, refs=ref, severity=severity,
263 name, data=data, desc=desc, refs=ref, severity=severity,
264264 resolution=resolution, confirmed=False,
265265 parent_id=host_id, parent_type='Host',
266266 workspace_name=self.workspace)
272272 @deprecation.deprecated(deprecated_in="3.0", removed_in="3.5",
273273 current_version=VERSION,
274274 details="Interface object removed. Use host or service instead. Vuln will be added to Host")
275 def createAndAddVulnToInterface(self, host_id, interface_id, name,
275 def createAndAddVulnToInterface(self, host_id, interface_id, name, data="",
276276 desc="", ref=[], severity="",
277277 resolution=""):
278278
279279 vuln_obj = model.common.factory.createModelObject(
280280 Vuln.class_signature,
281 name, desc=desc, refs=ref, severity=severity,
281 name, data=data, desc=desc, refs=ref, severity=severity,
282282 resolution=resolution, confirmed=False,
283283 parent_type='Host', parent_id=host_id,
284284 workspace_name=self.workspace)
287287 self.__addPendingAction(Modelactions.ADDVULNHOST, vuln_obj)
288288 return vuln_obj.getID()
289289
290 def createAndAddVulnToService(self, host_id, service_id, name, desc="",
290 def createAndAddVulnToService(self, host_id, service_id, name, desc="", data="",
291291 ref=[], severity="", resolution=""):
292292
293293 vuln_obj = model.common.factory.createModelObject(
294294 Vuln.class_signature,
295 name, desc=desc, refs=ref, severity=severity,
295 name, data=data, desc=desc, refs=ref, severity=severity,
296296 resolution=resolution, confirmed=False,
297297 parent_type='Service', parent_id=service_id,
298298 workspace_name=self.workspace)
301301 self.__addPendingAction(Modelactions.ADDVULNSRV, vuln_obj)
302302 return vuln_obj.getID()
303303
304 def createAndAddVulnWebToService(self, host_id, service_id, name, desc="",
304 def createAndAddVulnWebToService(self, host_id, service_id, name, data="", desc="",
305305 ref=[], severity="", resolution="",
306306 website="", path="", request="",
307307 response="", method="", pname="",
308308 params="", query="", category=""):
309309 vulnweb_obj = model.common.factory.createModelObject(
310310 VulnWeb.class_signature,
311 name, desc=desc, refs=ref, severity=severity,
311 name, data=data, desc=desc, refs=ref, severity=severity,
312312 resolution=resolution, website=website, path=path,
313313 request=request, response=response, method=method,
314314 pname=pname, params=params, query=query,
1010 from plugins import core
1111 from model import api
1212 import socket
13 import os
14 import random
1315 import re
1416
1517 try:
1921
2022 __author__ = 'Ezequiel Tavella'
2123 __copyright__ = 'Copyright 2016, Faraday Project'
22 __credits__ = ['Ezequiel Tavella', 'Matías Ariel Ré Medina', ]
24 __credits__ = ['Ezequiel Tavella', 'Matías Ariel Ré Medina', 'Conrad Stein K']
2325 __license__ = ''
24 __version__ = '1.0.1'
26 __version__ = '1.0.2'
2527 __status__ = 'Development'
2628
2729
289291
290292 # Get info about healthmap
291293 healthmap_tree = self.plugins_node.find('healthmap')
294 if not healthmap_tree:
295 return 'None'
292296
293297 # Create urls list.
294298 list_urls = []
471475 return
472476
473477 def processCommandString(self, username, current_path, command_string):
474
475 return
478 """
479 Use bash to run sequentialy arachni and arachni_reporter
480 """
481
482 afr_output_file_path = os.path.join(
483 self.data_path,
484 "%s_%s_output-%s.afr" % (
485 self.get_ws(),
486 self.id,
487 random.uniform(1, 10))
488 )
489
490 report_arg_re = r"^.*(--report-save-path[=\s][^\s]+).*$"
491 arg_match = re.match(report_arg_re,command_string)
492 if arg_match is None:
493 main_cmd = re.sub(r"(^.*?arachni)",
494 r"\1 --report-save-path=%s" % afr_output_file_path,
495 command_string)
496 else:
497 main_cmd = re.sub(arg_match.group(1),
498 r"--report-save-path=%s" % afr_output_file_path,
499 command_string)
500
501 # add reporter
502 self._output_file_path = re.sub('.afr', '.xml', afr_output_file_path)
503 cmd_prefix_match = re.match(r"(^.*?)arachni ", command_string)
504 cmd_prefix = cmd_prefix_match.group(1)
505 reporter_cmd = "%s%s --reporter=\"xml:outfile=%s\" \"%s\"" % (
506 cmd_prefix,
507 "arachni_reporter",
508 self._output_file_path,
509 afr_output_file_path)
510 return "/usr/bin/env -- bash -c '%s 2>&1 && if [ -e \"%s\" ];then %s 2>&1;fi'" % (main_cmd, afr_output_file_path, reporter_cmd)
511
476512
477513 def getHostname(self, url):
478514
2828 self.plugin_version = "0.0.1"
2929 self.version = "2.22"
3030 self.regexpUrl = r'((http[s]?)\:\/\/([\w\.]+)[.\S]+)'
31 self._command_regex = re.compile(r'^(sudo dirb|dirb|\.\/dirb|sudo \.\/dirb).*?')
31 self._command_regex = re.compile(r'^(?:sudo dirb|dirb|\.\/dirb|sudo \.\/dirb)\s+(?:(http[s]?)\:\/\/([\w\.]+)[.\S]+)')
3232 self.text = []
3333
3434
109109 return True
110110
111111
112
112113 def processCommandString(self, username, current_path, command_string):
114 """
115 Adds the -oX parameter to get xml output to the command string that the
116 user has set.
117 """
113118
114 arg = "%s -w" % command_string
115 return arg
119 no_stop_on_warn_msg_re = r"\s+-w"
120 arg_search = re.search(no_stop_on_warn_msg_re,command_string)
121 extra_arg = ""
122 if arg_search is None:
123 extra_arg +=" -w"
116124
125 silent_mode_re = r"\s+-S"
126 arg_search = re.search(silent_mode_re,command_string)
127 if arg_search is None:
128 extra_arg +=" -S"
129 return "%s%s" % (command_string, extra_arg)
117130
118131 def createPlugin():
119132 return dirbPlugin()
132132 resolution = ""
133133 resolution = v.get('solution').encode(
134134 "ascii", errors="backslashreplace") if v.get('solution') else ""
135 desc += "\nOutput: " + v.get('plugin_output').encode(
135
136 data = "\nOutput: " + v.get('plugin_output').encode(
136137 "ascii", errors="backslashreplace") if v.get('plugin_output') else ""
138
137139 ref = []
138140 if v.get('cve'):
139141 ref.append(", ".join(v.get('cve')))
145147 ref.append(", ".join(v.get('xref')))
146148 if v.get('svc_name') == "general":
147149 v_id = self.createAndAddVulnToHost(h_id, v.get('plugin_name'),
148 desc, ref, severity=v.get('severity'), resolution=resolution)
150 desc=desc, ref=ref, data=data, severity=v.get('severity'), resolution=resolution)
149151 else:
150152
151153 s_id = self.createAndAddServiceToInterface(h_id, i_id, v.get('svc_name'),
167169
168170 if web:
169171 v_id = self.createAndAddVulnWebToService(h_id, s_id, v.get('plugin_name'),
170 desc, website=host, severity=v.get(
172 desc=desc, data=data, website=host, severity=v.get(
171173 'severity'),
172174 resolution=resolution, ref=ref)
173175 else:
174176 v_id = self.createAndAddVulnToService(h_id, s_id, v.get('plugin_name'),
175 desc, severity=v.get('severity'), resolution=resolution,
177 desc=desc, data=data, severity=v.get('severity'), resolution=resolution,
176178 ref=ref)
177179
178180 def _isIPV4(self, ip):
77
88 '''
99 from __future__ import with_statement
10 import re
11 import os
12
1013 from plugins import core
1114 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
1715 try:
1816 import xml.etree.cElementTree as ET
1917 import xml.etree.ElementTree as ET_ORIG
5048 def __init__(self, xml_output):
5149 tree = self.parse_xml(xml_output)
5250 if tree:
53 self.items = [data for data in self.get_items(tree)]
51 vulns = self.get_vulns_list(tree)
52 self.items = [data for data in self.get_items(tree, vulns)]
53
5454 else:
5555 self.items = []
5656
7171
7272 return tree
7373
74 def get_items(self, tree):
74 def get_items(self, tree, vulnerabilities):
7575 """
7676 @return items A list of Host instances
7777 """
78 for node in tree.findall("devices/device"):
79 yield Item(node)
78 for node in tree.findall("nodes/node"):
79 yield Item(node, vulnerabilities)
80
81 def get_vulns_list(self, tree):
82 """
83 :param tree:
84 """
85 vulns_list = []
86 for self.issues in tree.findall("VulnerabilityDefinitions/vulnerability"):
87 vulns_list.append(self.issues)
88
89 return vulns_list
8090
8191
8292 class Item(object):
8797 @param item_node A item_node taken from an nexpose xml tree
8898 """
8999
90 def __init__(self, item_node):
100 def __init__(self, item_node, vulnerability):
91101 self.node = item_node
92102 self.ip = item_node.get('address')
93 self.os = self.get_text_from_subnode("fingerprint/description")
94
95 self.vulns = self.getResults(item_node)
96
103 self.os = self.get_version('fingerprints/os')
104 # Checking node's vulns
105 node_tests_list = self.get_tests('tests')
106 self.vulns_list = vulnerability
107 self.node_vulns = self.check_vulns(node_tests_list, self.vulns_list)
108 # Checking service's vulns
109 self.service = self.get_service('endpoints/endpoint', item_node)
110
111
112 def get_service(self, path, item_node):
113 """
114 Gets a service.
115
116 @return service
117 """
97118 self.srv = []
98
99 for srv in item_node.findall("services/service"):
119 for srv in item_node.findall(path):
120 self.node = srv
100121 item = {}
101 self.node = srv
102 item['name'] = srv.get('name')
122 tests_list = self.get_tests('services/service/tests')
123 item['name'] = self.get_name_from_service('services/service')
103124 item['port'] = srv.get('port')
104125 item['protocol'] = srv.get('protocol')
105 item['version'] = self.get_text_from_subnode(
106 "fingerprint/description")
107 item['vulns'] = self.getResults(srv)
126 item['status'] = srv.get('status')
127 item['version'] = self.get_version('services/service/fingerprints/fingerprint')
128 item['vulns'] = self.check_vulns(tests_list, self.vulns_list)
108129 self.srv.append(item)
109130
110 def getResults(self, tree):
111 """
112 :param tree:
113 """
114 for self.issues in tree.findall("vulnerabilities/vulnerability"):
115 yield Results(self.issues)
116
117 def get_text_from_subnode(self, subnode_xpath_expr):
118 """
119 Finds a subnode in the host node and the retrieves a value from it.
120
121 @return An attribute value
122 """
123 sub_node = self.node.find(subnode_xpath_expr)
131 return self.srv
132
133
134 def get_name_from_service(self, service_path):
135 """
136 Gets the name of a service.
137
138 @return service's attribute 'name'
139 """
140 sub_node = self.node.find(service_path)
141 if sub_node is not None:
142 return sub_node.get('name')
143
144 return None
145
146 def get_version(self, path):
147 """
148 Gets version of a host or a service.
149
150 @return attribute 'product' from a host or a service
151 """
152 sub_node = self.node.find(path)
153 if sub_node is not None:
154 return sub_node.attrib['product']
155
156 return None
157
158 def get_tests(self, test_path):
159 """
160 Gets every test in a service.
161
162 @return a list of every test
163 """
164 sub_node = self.node.find(test_path)
165 tests_list = []
166 for test in sub_node:
167 tests_list.append(test)
168 return tests_list
169
170 #Check which test of a node or service is a vuln
171 def check_vulns(self, list_of_tests, list_of_vulns):
172 """
173 Checks if a test of a host or a service is in the vulns list
174
175 @return a list of vulns of a host or a service
176 """
177 checked_vulns = []
178 vuln_attributes = {}
179 for test in list_of_tests:
180 for vuln in list_of_vulns:
181 if test.attrib['id'] == vuln.attrib['id']:
182 vuln_attributes['id'] = vuln.attrib['id']
183 vuln_attributes['ref'] = self.get_vulns_ref(vuln)
184 vuln_attributes['severity'] = self.severity_format(vuln.attrib['severity'])
185 vuln_attributes['description'] = self.convert_to_flat_text(vuln, 'description')
186 vuln_attributes['resolution'] = self.convert_to_flat_text(vuln, 'solution')
187 checked_vulns.append(vuln_attributes)
188
189 return checked_vulns
190
191 def severity_format(self, severity):
192 """
193 Convert Nexpose severity format into Faraday API severity format
194
195 @return a severity
196 """
197 if severity == '1' or severity == '2':
198 return 'low'
199 elif severity == '3' or severity == '4':
200 return 'medium'
201 elif severity >= '5' or severity <= '7':
202 return 'high'
203 elif severity >= '8':
204 return 'critical'
205
206 def get_vulns_ref(self, vuln):
207 """
208 Gets the references of a vuln
209
210 @return a list of sources of every reference
211 """
212 # PCISeverity: Policy violations can't be added to plugins
213 source = []
214 source.append("cvssScore-" + vuln.attrib['cvssScore'])
215 source.append("cvssVector-" + vuln.attrib['cvssVector'])
216
217 data = self.get_text_from_reference(vuln, "references/reference/[@source='CVE']")
218 if data:
219 source.append(data)
220
221 data = self.get_text_from_reference(vuln, "references/reference/[@source='BID']")
222 if data:
223 source.append("bid-" + data)
224
225 data = self.get_text_from_reference(vuln, "references/reference/[@source='OVAL']")
226 if data:
227 source.append("osvdb-" + data)
228
229 data = self.get_text_from_reference(vuln, "references/reference/[@source='SUSE']")
230 if data:
231 source.append("suse-" + data)
232
233 for sources in vuln.findall("references/reference/[@source='XF']"):
234 source.append("xf-" + sources.text)
235
236 for sources in vuln.findall("references/reference/[@source='REDHAT']"):
237 source.append("secunia-" + sources.text)
238
239 for sources in vuln.findall("references/reference/[@source='URL']"):
240 source.append("url-" + sources.text)
241
242 return source
243
244 def get_text_from_reference(self, vulnerability, reference_path):
245 """
246 Gets text from the references of a vulnerability.
247
248 @return A attribute value
249 """
250 sub_node = vulnerability.find(reference_path)
124251 if sub_node is not None:
125252 return sub_node.text
126253
127254 return None
128255
129
130 class Results():
131
132 def __init__(self, issue_node):
133 self.node = issue_node
134 self.name = issue_node.get('id')
135 self.ref = []
136 data = self.get_text_from_subnode("id/[@type='cve']")
137 if data:
138 self.ref.append(data)
139
140 data = self.get_text_from_subnode("id/[@type='bid']")
141 if data:
142 self.ref.append("bid-" + data)
143
144 data = self.get_text_from_subnode("id/[@type='osvdb']")
145 if data:
146 self.ref.append("osvdb-" + data)
147
148 for v in issue_node.findall("id/[@type='secunia']"):
149 self.ref.append("secunia-" + v.text)
150
151 for v in issue_node.findall("id/[@type='url']"):
152 self.ref.append("url-" + v.text)
153
154 self.url = self.get_text_from_subnode("key")
155
156 def get_text_from_subnode(self, subnode_xpath_expr):
157 """
158 Finds a subnode in the host node and the retrieves a value from it.
159
160 @return An attribute value
161 """
162 sub_node = self.node.find(subnode_xpath_expr)
163 if sub_node is not None:
164 return sub_node.text
165
166 return None
256 def convert_to_flat_text(self, vuln, tag):
257 """
258 Converts texts from multiples elements into one flat text
259
260 @return returns new text
261 """
262 self.description = vuln.find(tag)
263 xml_str = self.description.itertext()
264 aux_string = []
265 strings_list = [data for data in xml_str]
266 # Iterating each item of the list that contains the strings
267 for item in strings_list:
268 # Taking away '\n', '\t'
269 aux_item = item.rstrip()
270 if aux_item is not '':
271 string_text = aux_item.replace('\n','')
272 aux_string.append(string_text)
273
274 flatten_text = ' '.join(aux_string)
275 flat_text = ' '.join(flatten_text.split())
276
277 return flat_text
167278
168279
169280 class NexposePlugin(core.PluginBase):
187298 "nexpose_output-%s.xml" % self._rid)
188299
189300 def parseOutputString(self, output, debug=False):
190
191301 parser = NexposeXmlParser(output)
192302 for item in parser.items:
193 h_id = self.createAndAddHost(item.ip, item.os)
194 i_id = self.createAndAddInterface(
195 h_id, item.ip, ipv4_address=item.ip, hostname_resolution=item.ip)
196
197 for v in item.vulns:
198 v_id = self.createAndAddVulnToHost(h_id, v.name, ref=v.ref)
199
200 for s in item.srv:
201 web = False
202 s_id = self.createAndAddServiceToInterface(h_id, i_id, s['name'],
203 s['protocol'],
303 host_id = self.createAndAddHost(item.ip, item.os)
304
305 for vuln in item.node_vulns:
306 vuln_id = self.createAndAddVulnToHost(
307 host_id, vuln['id'],
308 ref=vuln['ref'],
309 severity=vuln['severity'],
310 desc=vuln['description'],
311 resolution=vuln['resolution']
312 )
313
314 for srv in item.service:
315 service_id = self.createAndAddServiceToHost(host_id, srv['name'],
316 srv['protocol'],
204317 ports=[
205 str(s['port'])],
206 status="open",
207 version=s['version'])
208 for v in s['vulns']:
209 if v.url:
210 v_id = self.createAndAddVulnWebToService(
211 h_id, s_id, v.name, ref=v.ref, website=item.ip, path=v.url)
212 if not web:
213 n_id = self.createAndAddNoteToService(
214 h_id, s_id, "website", "")
215 n2_id = self.createAndAddNoteToNote(
216 h_id, s_id, n_id, item.ip, "")
217 web = True
218 else:
219 v_id = self.createAndAddVulnToService(
220 h_id, s_id, v.name, ref=v.ref)
318 str(srv['port'])],
319 status=srv['status'],
320 version=srv['version'])
321 for vuln in srv['vulns']:
322 vuln_id = self.createAndAddVulnToService(
323 host_id,
324 service_id,
325 vuln['id'],
326 ref=vuln['ref'],
327 severity=vuln['severity'],
328 desc=vuln['description'],
329 resolution=vuln['resolution']
330 )
221331 del parser
222332
223333 def processCommandString(self, username, current_path, command_string):
231341 return NexposePlugin()
232342
233343 if __name__ == '__main__':
234 parser = NexposeXmlParser(sys.argv[1])
235 for item in parser.items:
236 if item.status == 'up':
237 print item
344 parser = NexposePlugin()
345 with open('/home/javier/report-xml1.0.xml', 'r') as report:
346 parser.parseOutputString(report.read())
347 for item in parser.items:
348 if item.status == 'up':
349 print item
222222 @return A list of (os_vendor_family_gen, accuracy)
223223 """
224224 # OS information about host with great acurracy.
225
225226 osclasses = self.node.findall('os/osclass')
226227 if osclasses == []:
227228 osclasses = self.node.findall('os/osmatch/osclass')
228229
229230 for osclass in osclasses:
230 os_vendor = osclass.get("vendor")
231 os_family = osclass.get("osfamily")
232 os_gen = osclass.get("osgen")
233 accuracy = osclass.get("accuracy")
231 os_vendor = osclass.get("vendor", "unknown")
232 os_family = osclass.get("osfamily", "unknown")
233 os_gen = osclass.get("osgen", "unknown")
234 accuracy = osclass.get("accuracy", "unknown")
234235
235236 yield ("%s %s %s" % (os_vendor, os_family, os_gen), accuracy)
236237
238239 if osclasses == []:
239240 services = self.node.findall("ports/port/service")
240241 for service in services:
241 ostype = service.get("ostype")
242 ostype = service.get("ostype", "unknown")
242243 yield ("%s" % ostype, 0)
244
243245
244246 def top_os_guess(self):
245247 """
88 '''
99 from __future__ import with_statement
1010 from plugins import core
11 from faraday import FARADAY_BASE
1112 import re
1213 import os
1314 import sys
7980 @return items A list of Host instances
8081 """
8182 try:
83 report = tree.findall('report')[0]
8284 node = tree.findall('report')[0]
8385 node2 = node.findall('results')[0]
8486 for node in node2.findall('result'):
85 yield Item(node)
87 yield Item(node,report)
8688
8789 except Exception:
8890
132134 @param item_node A item_node taken from an openvas xml tree
133135 """
134136
135 def __init__(self, item_node):
137 def __init__(self, item_node, report):
136138 self.node = item_node
137139
138140 self.host = self.get_text_from_subnode('host')
148150 self.protocol = ""
149151 port = self.get_text_from_subnode('port')
150152
151 if re.search("^general", port) is None:
152
153 mregex = re.search("([\w]+) \(([\d]+)\/([\w]+)\)", port)
154
155 if mregex is not None:
156 self.service = mregex.group(1)
157 self.port = mregex.group(2)
158 self.protocol = mregex.group(2)
159 else:
160 info = port.split("/")
161 self.port = info[0]
162 self.protocol = info[1]
153 if "general" not in port:
154 # service vuln
155 info = port.split("/")
156 self.port = info[0]
157 self.protocol = info[1]
158 self.service = self.get_service(port, report, self.host)
163159 else:
160 # general was found in port data
161 # this is a host vuln
162 # this case will have item.port = 'None'
164163 info = port.split("/")
165 self.service = info[0]
166164 self.protocol = info[1]
165 self.service = info[0] # this value is general
167166
168167 self.nvt = self.node.findall('nvt')[0]
169168 self.node = self.nvt
176175 self.xref = self.get_text_from_subnode(
177176 'xref') if self.get_text_from_subnode('xref') != "NOXREF" else ""
178177
178
179179 def do_clean(self, value):
180180 myreturn = ""
181181 if value is not None:
193193 return sub_node.text
194194
195195 return ''
196
197
198 def get_service(self, port, report, host_ip):
199 detail = self.get_detail_from_host(report,host_ip)
200
201 # dict detail:
202 # key is the host ip
203 # value_dict is a dictionary with every detail in the host
204 for key,value_dict in detail.items():
205 service_detail = self.get_service_from_details(value_dict,port)
206
207 if service_detail:
208 return service_detail
209
210 # if the service is not in detail, we will search it in
211 # the file port_mapper.txt
212 srv = self.filter_services()
213 for service in srv:
214 if service[0] == port:
215 return service[1]
216
217 return "Unknown"
218
219 def filter_services(self):
220 open_file = open(os.path.join(FARADAY_BASE,'plugins/repo/openvas/port_mapper.txt'),"r")
221 mapper = open_file.read()
222 filtering = mapper.split('\n')
223
224 services = []
225
226 for item in filtering:
227 tup = ()
228 filt = filter(len,item.split('\t'))
229 tup = (filt[0],filt[1])
230 services.append(tup)
231
232 return services
233
234 def get_detail_from_host(self, report, host_ip):
235 hosts = report.findall('host')
236 host_dict = {}
237 for host in hosts:
238 if host[0].text == host_ip.strip():
239 details = self.get_details(host)
240 host_dict[host.find('ip').text] = details
241
242 return host_dict
243
244 def get_details(self, host):
245 details_list = host.findall('detail')
246 details_dict = {}
247
248 for item in details_list:
249 name = item.find('name').text
250 if not 'EXIT' in name:
251 details_dict[item.find('value').text] = name
252
253 return details_dict
254
255 def get_service_from_details(self, value_dict, port):
256 # dict value:
257 # key is port or protocol of the service
258 # value is service description
259 for key, value in value_dict.items():
260 if value == 'Services':
261 aux_port = port.split('/')[0]
262
263 key_splited = key.split(',')
264
265 if key_splited[0] == aux_port:
266 return key_splited[2]
267
268 for k,v in value_dict.items():
269 if '/' in k:
270 auxiliar_key = k.split('/')[0]
271
272 if auxiliar_key == port.split('/')[0]:
273 return v
274
275 elif k.isdigit():
276 if k == port.split('/')[0]:
277 return v
278 elif '::' in k:
279 aux_key = k.split('::')[0]
280 auxiliar_port = port.split('/')[0]
281
282 if aux_key == auxiliar_port:
283 return v
284
285
286 return None
196287
197288
198289 class OpenvasPlugin(core.PluginBase):
351442 return OpenvasPlugin()
352443
353444 if __name__ == '__main__':
354 parser = OpenvasXmlParser(sys.argv[1])
355 for item in parser.items:
356 if item.status == 'up':
357 print item
445 with open("/home/javier/report_openvas.xml","r") as report:
446 parser = OpenvasXmlParser(report.read())
447 #for item in parser.items:
448 #if item.status == 'up':
449 #print item
0 1/tcp tcpmux
1 7/tcp echo
2 7/udp echo
3 9/tcp discard
4 9/udp discard
5 11/tcp systat
6 13/tcp daytime
7 13/udp daytime
8 15/tcp netstat
9 17/tcp qotd
10 18/tcp msp
11 18/udp msp
12 19/tcp chargen
13 19/udp chargen
14 20/tcp ftp-data
15 21/tcp ftp
16 21/udp fsp
17 22/tcp ssh
18 22/udp ssh
19 23/tcp telnet
20 25/tcp smtp
21 37/tcp time
22 37/udp time
23 39/udp rlp
24 42/tcp nameserver
25 43/tcp whois
26 49/tcp tacacs
27 49/udp tacacs
28 50/tcp re-mail-ck
29 50/udp re-mail-ck
30 53/tcp domain
31 53/udp domain
32 57/tcp mtp
33 65/tcp tacacs-ds
34 65/udp tacacs-ds
35 67/tcp bootps
36 67/udp bootps
37 68/tcp bootpc
38 68/udp bootpc
39 69/udp tftp
40 70/tcp gopher
41 70/udp gopher
42 77/tcp rje
43 79/tcp finger
44 80/tcp http
45 80/udp http
46 87/tcp link
47 88/tcp kerberos
48 88/udp kerberos
49 95/tcp supdup
50 101/tcp hostnames
51 102/tcp iso-tsap
52 104/tcp acr-nema
53 104/udp acr-nema
54 105/tcp csnet-ns
55 105/udp csnet-ns
56 107/tcp rtelnet
57 107/udp rtelnet
58 109/tcp pop2
59 109/udp pop2
60 110/tcp pop3
61 110/udp pop3
62 111/tcp sunrpc
63 111/udp sunrpc
64 113/tcp auth
65 115/tcp sftp
66 117/tcp uucp-path
67 119/tcp nntp
68 123/tcp ntp
69 123/udp ntp
70 129/tcp pwdgen
71 129/udp pwdgen
72 135/tcp loc-srv
73 135/udp loc-srv
74 137/tcp netbios-ns
75 137/udp netbios-ns
76 138/tcp netbios-dgm
77 138/udp netbios-dgm
78 139/tcp netbios-ssn
79 139/udp netbios-ssn
80 143/tcp imap2
81 143/udp imap2
82 161/tcp snmp
83 161/udp snmp
84 162/tcp snmp-trap
85 162/udp snmp-trap
86 163/tcp cmip-man
87 163/udp cmip-man
88 164/tcp cmip-agent
89 164/udp cmip-agent
90 174/tcp mailq
91 174/udp mailq
92 177/tcp xdmcp
93 177/udp xdmcp
94 178/tcp nextstep
95 178/udp nextstep
96 179/tcp bgp
97 179/udp bgp
98 191/tcp prospero
99 191/udp prospero
100 194/tcp irc
101 194/udp irc
102 199/tcp smux
103 199/udp smux
104 201/tcp at-rtmp
105 201/udp at-rtmp
106 202/tcp at-nbp
107 202/udp at-nbp
108 204/tcp at-echo
109 204/udp at-echo
110 206/tcp at-zis
111 206/udp at-zis
112 209/tcp qmtp
113 209/udp qmtp
114 210/tcp z3950
115 210/udp z3950
116 213/tcp ipx
117 213/udp ipx
118 220/tcp imap3
119 220/udp imap3
120 345/tcp pawserv
121 345/udp pawserv
122 346/tcp zserv
123 346/udp zserv
124 347/tcp fatserv
125 347/udp fatserv
126 369/tcp rpc2portmap
127 369/udp rpc2portmap
128 370/tcp codaauth2
129 370/udp codaauth2
130 371/tcp clearcase
131 371/udp clearcase
132 372/tcp ulistserv
133 372/udp ulistserv
134 389/tcp ldap
135 389/udp ldap
136 406/tcp imsp
137 406/udp imsp
138 427/tcp svrloc
139 427/udp svrloc
140 443/tcp https
141 443/udp https
142 444/tcp snpp
143 444/udp snpp
144 445/tcp microsoft-ds
145 445/udp microsoft-ds
146 464/tcp kpasswd
147 464/udp kpasswd
148 465/tcp urd
149 487/tcp saft
150 487/udp saft
151 500/tcp isakmp
152 500/udp isakmp
153 554/tcp rtsp
154 554/udp rtsp
155 607/tcp nqs
156 607/udp nqs
157 610/tcp npmp-local
158 610/udp npmp-local
159 611/tcp npmp-gui
160 611/udp npmp-gui
161 612/tcp hmmp-ind
162 612/udp hmmp-ind
163 623/udp asf-rmcp
164 628/tcp qmqp
165 628/udp qmqp
166 631/tcp ipp
167 631/udp ipp
168 512/tcp exec
169 512/udp biff
170 513/tcp login
171 513/udp who
172 514/tcp shell
173 514/udp syslog
174 515/tcp printer
175 517/udp talk
176 518/udp ntalk
177 520/udp route
178 525/udp timed
179 526/tcp tempo
180 530/tcp courier
181 531/tcp conference
182 532/tcp netnews
183 533/udp netwall
184 538/tcp gdomap
185 538/udp gdomap
186 540/tcp uucp
187 543/tcp klogin
188 544/tcp kshell
189 546/tcp dhcpv6-client
190 546/udp dhcpv6-client
191 547/tcp dhcpv6-server
192 547/udp dhcpv6-server
193 548/tcp afpovertcp
194 548/udp afpovertcp
195 549/tcp idfp
196 549/udp idfp
197 556/tcp remotefs
198 563/tcp nntps
199 563/udp nntps
200 587/tcp submission
201 587/udp submission
202 636/tcp ldaps
203 636/udp ldaps
204 655/tcp tinc
205 655/udp tinc
206 706/tcp silc
207 706/udp silc
208 749/tcp kerberos-adm
209 765/tcp webster
210 765/udp webster
211 873/tcp rsync
212 873/udp rsync
213 989/tcp ftps-data
214 990/tcp ftps
215 992/tcp telnets
216 992/udp telnets
217 993/tcp imaps
218 993/udp imaps
219 994/tcp ircs
220 994/udp ircs
221 995/tcp pop3s
222 995/udp pop3s
223 1080/tcp socks
224 1080/udp socks
225 1093/tcp proofd
226 1093/udp proofd
227 1094/tcp rootd
228 1094/udp rootd
229 1194/tcp openvpn
230 1194/udp openvpn
231 1099/tcp rmiregistry
232 1099/udp rmiregistry
233 1214/tcp kazaa
234 1214/udp kazaa
235 1241/tcp nessus
236 1241/udp nessus
237 1352/tcp lotusnote
238 1352/udp lotusnote
239 1433/tcp ms-sql-s
240 1433/udp ms-sql-s
241 1434/tcp ms-sql-m
242 1434/udp ms-sql-m
243 1524/tcp ingreslock
244 1524/udp ingreslock
245 1525/tcp prospero-np
246 1525/udp prospero-np
247 1645/tcp datametrics
248 1645/udp datametrics
249 1646/tcp sa-msg-port
250 1646/udp sa-msg-port
251 1649/tcp kermit
252 1649/udp kermit
253 1677/tcp groupwise
254 1677/udp groupwise
255 1701/tcp l2f
256 1701/udp l2f
257 1812/tcp radius
258 1812/udp radius
259 1813/tcp radius-acct
260 1813/udp radius-acct
261 1863/tcp msnp
262 1863/udp msnp
263 1957/tcp unix-status
264 1958/tcp log-server
265 1959/tcp remoteping
266 2000/tcp cisco-sccp
267 2000/udp cisco-sccp
268 2010/tcp search
269 2010/tcp pipe-server
270 2049/tcp nfs
271 2049/udp nfs
272 2086/tcp gnunet
273 2086/udp gnunet
274 2101/tcp rtcm-sc104
275 2101/udp rtcm-sc104
276 2119/tcp gsigatekeeper
277 2119/udp gsigatekeeper
278 2135/tcp gris
279 2135/udp gris
280 2401/tcp cvspserver
281 2401/udp cvspserver
282 2430/tcp venus
283 2430/udp venus
284 2431/tcp venus-se
285 2431/udp venus-se
286 2432/tcp codasrv
287 2432/udp codasrv
288 2433/tcp codasrv-se
289 2433/udp codasrv-se
290 2583/tcp mon
291 2583/udp mon
292 2628/tcp dict
293 2628/udp dict
294 2792/tcp f5-globalsite
295 2792/udp f5-globalsite
296 2811/tcp gsiftp
297 2811/udp gsiftp
298 2947/tcp gpsd
299 2947/udp gpsd
300 3050/tcp gds-db
301 3050/udp gds-db
302 3130/tcp icpv2
303 3130/udp icpv2
304 3260/tcp iscsi-target
305 3306/tcp mysql
306 3306/udp mysql
307 3493/tcp nut
308 3493/udp nut
309 3632/tcp distcc
310 3632/udp distcc
311 3689/tcp daap
312 3689/udp daap
313 3690/tcp svn
314 3690/udp svn
315 4031/tcp suucp
316 4031/udp suucp
317 4094/tcp sysrqd
318 4094/udp sysrqd
319 4190/tcp sieve
320 4369/tcp epmd
321 4369/udp epmd
322 4373/tcp remctl
323 4373/udp remctl
324 4353/tcp f5-iquery
325 4353/udp f5-iquery
326 4500/udp ipsec-nat-t
327 4569/tcp iax
328 4569/udp iax
329 4691/tcp mtn
330 4691/udp mtn
331 4899/tcp radmin-port
332 4899/udp radmin-port
333 5002/udp rfe
334 5002/tcp rfe
335 5050/tcp mmcc
336 5050/udp mmcc
337 5060/tcp sip
338 5060/udp sip
339 5061/tcp sip-tls
340 5061/udp sip-tls
341 5190/tcp aol
342 5190/udp aol
343 5222/tcp xmpp-client
344 5222/udp xmpp-client
345 5269/tcp xmpp-server
346 5269/udp xmpp-server
347 5308/tcp cfengine
348 5308/udp cfengine
349 5353/tcp mdns
350 5353/udp mdns
351 5432/tcp postgresql
352 5432/udp postgresql
353 5556/tcp freeciv
354 5556/udp freeciv
355 5671/tcp amqps
356 5672/tcp amqp
357 5672/udp amqp
358 5672/sctp amqp
359 5688/tcp ggz
360 5688/udp ggz
361 6000/tcp x11
362 6000/udp x11
363 6001/tcp x11-1
364 6001/udp x11-1
365 6002/tcp x11-2
366 6002/udp x11-2
367 6003/tcp x11-3
368 6003/udp x11-3
369 6004/tcp x11-4
370 6004/udp x11-4
371 6005/tcp x11-5
372 6005/udp x11-5
373 6006/tcp x11-6
374 6006/udp x11-6
375 6007/tcp x11-7
376 6007/udp x11-7
377 6346/tcp gnutella-svc
378 6346/udp gnutella-svc
379 6347/tcp gnutella-rtr
380 6347/udp gnutella-rtr
381 6444/tcp sge-qmaster
382 6444/udp sge-qmaster
383 6445/tcp sge-execd
384 6445/udp sge-execd
385 6446/tcp mysql-proxy
386 6446/udp mysql-proxy
387 7000/tcp afs3-fileserver
388 7000/udp afs3-fileserver
389 7001/tcp afs3-callback
390 7001/udp afs3-callback
391 7002/tcp afs3-prserver
392 7002/udp afs3-prserver
393 7003/tcp afs3-vlserver
394 7003/udp afs3-vlserver
395 7004/tcp afs3-kaserver
396 7004/udp afs3-kaserver
397 7005/tcp afs3-volser
398 7005/udp afs3-volser
399 7006/tcp afs3-errors
400 7006/udp afs3-errors
401 7007/tcp afs3-bos
402 7007/udp afs3-bos
403 7008/tcp afs3-update
404 7008/udp afs3-update
405 7009/tcp afs3-rmtsys
406 7009/udp afs3-rmtsys
407 7100/tcp font-service
408 7100/udp font-service
409 8080/tcp http-alt
410 8080/udp http-alt
411 9101/tcp bacula-dir
412 9101/udp bacula-dir
413 9102/tcp bacula-fd
414 9102/udp bacula-fd
415 9103/tcp bacula-sd
416 9103/udp bacula-sd
417 9667/tcp xmms2
418 9667/udp xmms2
419 10809/tcp nbd
420 10050/tcp zabbix-agent
421 10050/udp zabbix-agent
422 10051/tcp zabbix-trapper
423 10051/udp zabbix-trapper
424 10080/tcp amanda
425 10080/udp amanda
426 11112/tcp dicom
427 11371/tcp hkp
428 11371/udp hkp
429 13720/tcp bprd
430 13720/udp bprd
431 13721/tcp bpdbm
432 13721/udp bpdbm
433 13722/tcp bpjava-msvc
434 13722/udp bpjava-msvc
435 13724/tcp vnetd
436 13724/udp vnetd
437 13782/tcp bpcd
438 13782/udp bpcd
439 13783/tcp vopied
440 13783/udp vopied
441 17500/tcp db-lsp
442 22125/tcp dcap
443 22128/tcp gsidcap
444 22273/tcp wnn6
445 22273/udp wnn6
446 1/ddp rtmp
447 2/ddp nbp
448 4/ddp echo
449 6/ddp zip
450 750/udp kerberos4
451 750/tcp kerberos4
452 751/udp kerberos-master
453 751/tcp kerberos-master
454 752/udp passwd-server
455 754/tcp krb-prop
456 760/tcp krbupdate
457 901/tcp swat
458 1109/tcp kpop
459 2053/tcp knetd
460 2102/udp zephyr-srv
461 2103/udp zephyr-clt
462 2104/udp zephyr-hm
463 2105/tcp eklogin
464 2111/tcp kx
465 2121/tcp iprop
466 871/tcp supfilesrv
467 1127/tcp supfiledbg
468 98/tcp linuxconf
469 106/tcp poppassd
470 106/udp poppassd
471 775/tcp moira-db
472 777/tcp moira-update
473 779/udp moira-ureg
474 783/tcp spamd
475 808/tcp omirr
476 808/udp omirr
477 1001/tcp customs
478 1001/udp customs
479 1178/tcp skkserv
480 1210/udp predict
481 1236/tcp rmtcfg
482 1300/tcp wipld
483 1313/tcp xtel
484 1314/tcp xtelw
485 1529/tcp support
486 2003/tcp cfinger
487 2121/tcp frox
488 2150/tcp ninstall
489 2150/udp ninstall
490 2600/tcp zebrasrv
491 2601/tcp zebra
492 2602/tcp ripd
493 2603/tcp ripngd
494 2604/tcp ospfd
495 2605/tcp bgpd
496 2606/tcp ospf6d
497 2607/tcp ospfapi
498 2608/tcp isisd
499 2988/tcp afbackup
500 2988/udp afbackup
501 2989/tcp afmbackup
502 2989/udp afmbackup
503 4224/tcp xtell
504 4557/tcp fax
505 4559/tcp hylafax
506 4600/tcp distmp3
507 4949/tcp munin
508 5051/tcp enbd-cstatd
509 5052/tcp enbd-sstatd
510 5151/tcp pcrd
511 5354/tcp noclog
512 5354/udp noclog
513 5355/tcp hostmon
514 5355/udp hostmon
515 5555/udp rplay
516 5666/tcp nrpe
517 5667/tcp nsca
518 5674/tcp mrtd
519 5675/tcp bgpsim
520 5680/tcp canna
521 6514/tcp syslog-tls
522 6566/tcp sane-port
523 6667/tcp ircd
524 8021/tcp zope-ftp
525 8081/tcp tproxy
526 8088/tcp omniorb
527 8088/udp omniorb
528 8990/tcp clc-build-daemon
529 9098/tcp xinetd
530 9359/udp mandelspawn
531 9418/tcp git
532 9673/tcp zope
533 10000/tcp webmin
534 10081/tcp kamanda
535 10081/udp kamanda
536 10082/tcp amandaidx
537 10083/tcp amidxtape
538 11201/tcp smsqp
539 11201/udp smsqp
540 15345/tcp xpilot
541 15345/udp xpilot
542 17001/udp sgi-cmsd
543 17002/udp sgi-crsd
544 17003/udp sgi-gcd
545 17004/tcp sgi-cad
546 20011/tcp isdnlog
547 20011/udp isdnlog
548 20012/tcp vboxd
549 20012/udp vboxd
550 24554/tcp binkp
551 27374/tcp asp
552 27374/udp asp
553 30865/tcp csync2
554 57000/tcp dircproxy
555 60177/tcp tfido
556 60179/tcp fido
557 1027/udp Native IPv6 behind IPv4-to-IPv4 NAT Customer Premises Equipment (6a44)
558 1058/tcp nim, IBM AIX Network Installation Manager (NIM)
559 1058/udp nim, IBM AIX Network Installation Manager (NIM)
560 1059/tcp nimreg, IBM AIX Network Installation Manager (NIM)
561 1059/udp nimreg, IBM AIX Network Installation Manager (NIM)
562 1080/tcp SOCKS proxy
563 1080/udp SOCKS proxy
564 1085/tcp WebObjects
565 1085/udp WebObjects
566 1098/tcp rmiactivation, Java remote method invocation (RMI) activation
567 1098/udp rmiactivation, Java remote method invocation (RMI) activation
568 1099/tcp rmiregistry, Java remote method invocation (RMI) registry
569 1099/assigned rmiregistry, Java remote method invocation (RMI) registry
570 1119/tcp Battle.net chat/game protocol, used by Blizzard's games
571 1119/udp Battle.net chat/game protocol, used by Blizzard's games
572 1167/udp Cisco IP SLA (Service Assurance Agent)
573 1167/tcp Cisco IP SLA (Service Assurance Agent)
574 1194/udp OpenVPN
575 1194/tcp OpenVPN
576 1198/udp The cajo project Free dynamic transparent distributed computing in Java
577 1198/tcp The cajo project Free dynamic transparent distributed computing in Java
578 1214/udp Kazaa
579 1214/tcp Kazaa
580 1234/udp Infoseek search agent
581 1234/tcp Infoseek search agent
582 1241/udp Nessus Security Scanner
583 1241/tcp Nessus Security Scanner
584 1270/udp Microsoft System Center Operations Manager (SCOM) (formerly Microsoft Operations Manager (MOM)) agent
585 1270/tcp Microsoft System Center Operations Manager (SCOM) (formerly Microsoft Operations Manager (MOM)) agent
586 1293/udp Internet Protocol Security (IPSec)
587 1293/tcp Internet Protocol Security (IPSec)
588 1311/udp Windows RxMon.exe
589 1311/tcp Windows RxMon.exe
590 1341/udp Qubes (Manufacturing Execution System)
591 1341/tcp Qubes (Manufacturing Execution System)
592 1344/udp Internet Content Adaptation Protocol
593 1344/tcp Internet Content Adaptation Protocol
594 1352/udp IBM Lotus Notes/Domino (RPC) protocol
595 1352/tcp IBM Lotus Notes/Domino (RPC) protocol
596 1360/udp Mimer SQL
597 1360/tcp Mimer SQL
598 1414/udp IBM WebSphere MQ (formerly known as MQSeries)
599 1414/tcp IBM WebSphere MQ (formerly known as MQSeries)
600 1417/udp Timbuktu Service 1 Port
601 1417/tcp Timbuktu Service 1 Port
602 1418/udp Timbuktu Service 2 Port
603 1418/tcp Timbuktu Service 2 Port
604 1419/udp Timbuktu Service 3 Port
605 1419/tcp Timbuktu Service 3 Port
606 1420/udp Timbuktu Service 4 Port
607 1420/tcp Timbuktu Service 4 Port
608 1433/udp Microsoft SQL Server database management system (MSSQL) server
609 1433/tcp Microsoft SQL Server database management system (MSSQL) server
610 1434/udp Microsoft SQL Server database management system (MSSQL) monitor
611 1434/tcp Microsoft SQL Server database management system (MSSQL) monitor
612 1512/udp Microsoft's Windows Internet Name Service (WINS)
613 1512/tcp Microsoft's Windows Internet Name Service (WINS)
614 1521/udp nCUBE License Manager
615 1521/tcp nCUBE License Manager
616 1524/udp ingreslock, ingres
617 1524/tcp ingreslock, ingres
618 1527/udp Oracle Net Services, formerly known as SQL*Net
619 1527/tcp Oracle Net Services, formerly known as SQL*Net
620 1533/udp IBM Sametime Virtual Places Chat
621 1533/tcp IBM Sametime Virtual Places Chat
622 1547/udp Laplink
623 1547/tcp Laplink
624 1581/udp MIL STD 2045-47001 VMF
625 1581/tcp MIL STD 2045-47001 VMF
626 1589/udp Cisco VLAN Query Protocol (VQP)
627 1589/tcp Cisco VLAN Query Protocol (VQP)
628 1628/udp LonTalk normal
629 1628/tcp LonTalk normal
630 1629/udp LonTalk urgent
631 1629/tcp LonTalk urgent
632 1677/udp Novell GroupWise clients in client/server access mode
633 1677/tcp Novell GroupWise clients in client/server access mode
634 1701/udp Layer 2 Forwarding Protocol (L2F)
635 1701/tcp Layer 2 Forwarding Protocol (L2F)
636 1701/udp Layer 2 Tunneling Protocol (L2TP)
637 1701/assigned Layer 2 Tunneling Protocol (L2TP)
638 1707/udp Windward Studios games (vdmplay)
639 1707/tcp Windward Studios games (vdmplay)
640 1719/udp H.323 registration and alternate communication
641 1719/tcp H.323 registration and alternate communication
642 1720/udp H.323 call signaling
643 1720/tcp H.323 call signaling
644 1755/udp Microsoft Media Services (MMS, ms-streaming)
645 1755/tcp Microsoft Media Services (MMS, ms-streaming)
646 1801/udp Microsoft Message Queuing
647 1801/tcp Microsoft Message Queuing
648 1812/udp RADIUS authentication protocol, radius
649 1812/tcp RADIUS authentication protocol, radius
650 1813/udp RADIUS accounting protocol, radius-acct
651 1813/tcp RADIUS accounting protocol, radius-acct
652 1863/udp Microsoft Notification Protocol (MSNP), used by the Microsoft Messenger service and a number of instant messaging Messenger clients
653 1863/tcp Microsoft Notification Protocol (MSNP), used by the Microsoft Messenger service and a number of instant messaging Messenger clients
654 1883/udp MQTT (formerly MQ Telemetry Transport)
655 1883/tcp MQTT (formerly MQ Telemetry Transport)
656 1900/udp Simple Service Discovery Protocol (SSDP), discovery of UPnP devices
657 1900/assigned Simple Service Discovery Protocol (SSDP), discovery of UPnP devices
658 1935/udp Macromedia Flash Communications Server MX, the precursor to Adobe Flash Media Server before Macromedia's acquisition by Adobe on December 3, 2005
659 1935/tcp Macromedia Flash Communications Server MX, the precursor to Adobe Flash Media Server before Macromedia's acquisition by Adobe on December 3, 2005
660 1970/udp Netop Remote Control
661 1970/tcp Netop Remote Control
662 1972/udp InterSystems Caché
663 1972/tcp InterSystems Caché
664 1984/udp Big Brother
665 1984/tcp Big Brother
666 1985/udp Cisco Hot Standby Router Protocol (HSRP)
667 1985/assigned Cisco Hot Standby Router Protocol (HSRP)
668 1998/udp Cisco X.25 over TCP (XOT) service
669 1998/tcp Cisco X.25 over TCP (XOT) service
670 2000/udp Cisco Skinny Client Control Protocol (SCCP)
671 2000/tcp Cisco Skinny Client Control Protocol (SCCP)
672 2080/udp Autodesk NLM (FLEXlm)
673 2080/tcp Autodesk NLM (FLEXlm)
674 2083/udp Secure RADIUS Service (radsec)
675 2083/tcp Secure RADIUS Service (radsec)
676 2086/udp GNUnet
677 2086/tcp GNUnet
678 2102/udp Zephyr Notification Service server
679 2102/tcp Zephyr Notification Service server
680 2103/udp Zephyr Notification Service serv-hm connection
681 2103/tcp Zephyr Notification Service serv-hm connection
682 2104/udp Zephyr Notification Service hostmanager
683 2104/tcp Zephyr Notification Service hostmanager
684 2123/udp GTP control messages (GTP-C)
685 2123/tcp GTP control messages (GTP-C)
686 2142/udp TDMoIP (TDM over IP)
687 2142/tcp TDMoIP (TDM over IP)
688 2152/udp GTP user data messages (GTP-U)
689 2152/tcp GTP user data messages (GTP-U)
690 2159/udp GDB remote debug port
691 2159/tcp GDB remote debug port
692 2181/udp EForward-document transport system
693 2181/tcp EForward-document transport system
694 2210/udp NOAAPORT Broadcast Network
695 2210/tcp NOAAPORT Broadcast Network
696 2211/udp EMWIN
697 2211/tcp EMWIN
698 2222/udp EtherNet/IP implicit messaging for IO data
699 2222/tcp EtherNet/IP implicit messaging for IO data
700 2261/udp CoMotion master
701 2261/tcp CoMotion master
702 2262/udp CoMotion backup
703 2262/tcp CoMotion backup
704 2266/udp M-Files
705 2266/tcp M-Files
706 2399/udp FileMaker Data Access Layer (ODBC/JDBC)
707 2399/tcp FileMaker Data Access Layer (ODBC/JDBC)
708 2401/udp CVS version control system password-based server
709 2401/tcp CVS version control system password-based server
710 2404/udp IEC 60870-5-104, used to send electric power telecontrol messages between two systems via directly connected data circuits
711 2404/tcp IEC 60870-5-104, used to send electric power telecontrol messages between two systems via directly connected data circuits
712 2427/udp Media Gateway Control Protocol (MGCP) media gateway
713 2427/tcp Media Gateway Control Protocol (MGCP) media gateway
714 2447/udp ovwdb—OpenView Network Node Manager (NNM) daemon
715 2447/tcp ovwdb—OpenView Network Node Manager (NNM) daemon
716 2483/udp Oracle database listening for insecure client connections to the listener, replaces port 1521
717 2483/tcp Oracle database listening for insecure client connections to the listener, replaces port 1521
718 2484/udp Oracle database listening for SSL client connections to the listener
719 2484/tcp Oracle database listening for SSL client connections to the listener
720 2535/udp Multicast Address Dynamic Client Allocation Protocol (MADCAP). All standard messages are UDP datagrams.
721 2535/tcp Multicast Address Dynamic Client Allocation Protocol (MADCAP). All standard messages are UDP datagrams.
722 2541/udp LonTalk/IP
723 2541/tcp LonTalk/IP
724 2546/udp EVault data protection services
725 2546/tcp EVault data protection services
726 2547/udp EVault data protection services
727 2547/tcp EVault data protection services
728 2548/udp EVault data protection services
729 2548/tcp EVault data protection services
730 2638/udp SQL Anywhere database server
731 2638/tcp SQL Anywhere database server
732 2727/udp Media Gateway Control Protocol (MGCP) media gateway controller (call agent)
733 2727/tcp Media Gateway Control Protocol (MGCP) media gateway controller (call agent)
734 2809/udp corbaloc:iiop URL, per the CORBA 3.0.3 specification
735 2809/tcp corbaloc:iiop URL, per the CORBA 3.0.3 specification
736 2811/udp gsi ftp, per the GridFTP specification
737 2811/tcp gsi ftp, per the GridFTP specification
738 2944/udp Megaco text H.248
739 2944/tcp Megaco text H.248
740 2945/udp Megaco binary (ASN.1) H.248
741 2945/tcp Megaco binary (ASN.1) H.248
742 2947/udp gpsd, GPS daemon
743 2947/tcp gpsd, GPS daemon
744 2948/udp WAP push Multimedia Messaging Service (MMS)
745 2948/tcp WAP push Multimedia Messaging Service (MMS)
746 2949/udp WAP push secure (MMS)
747 2949/tcp WAP push secure (MMS)
748 2967/udp Symantec System Center agent (SSC-AGENT)
749 2967/tcp Symantec System Center agent (SSC-AGENT)
750 3020/udp Common Internet File System (CIFS). See also port 445 for Server Message Block (SMB), a dialect of CIFS.
751 3020/tcp Common Internet File System (CIFS). See also port 445 for Server Message Block (SMB), a dialect of CIFS.
752 3050/udp gds-db (Interbase/Firebird databases)
753 3050/tcp gds-db (Interbase/Firebird databases)
754 3052/udp APC PowerChute Network
755 3052/tcp APC PowerChute Network
756 3074/udp Xbox LIVE and Games for Windows – Live
757 3074/tcp Xbox LIVE and Games for Windows – Live
758 3225/udp Fibre Channel over IP (FCIP)
759 3225/tcp Fibre Channel over IP (FCIP)
760 3233/udp WhiskerControl research control protocol
761 3233/tcp WhiskerControl research control protocol
762 3260/udp iSCSI
763 3260/tcp iSCSI
764 3268/udp msft-gc, Microsoft Global Catalog (LDAP service which contains data from Active Directory forests)
765 3268/tcp msft-gc, Microsoft Global Catalog (LDAP service which contains data from Active Directory forests)
766 3269/udp msft-gc-ssl, Microsoft Global Catalog over SSL (similar to port 3268, LDAP over SSL)
767 3269/tcp msft-gc-ssl, Microsoft Global Catalog over SSL (similar to port 3268, LDAP over SSL)
768 3283/udp Net Assistant, a predecessor to Apple Remote Desktop
769 3283/tcp Net Assistant, a predecessor to Apple Remote Desktop
770 3305/udp Odette File Transfer Protocol (OFTP)
771 3305/tcp Odette File Transfer Protocol (OFTP)
772 3386/udp GTP' 3GPP GSM/UMTS CDR logging protocol
773 3386/tcp GTP' 3GPP GSM/UMTS CDR logging protocol
774 3389/udp Microsoft Terminal Server (RDP) officially registered as Windows Based Terminal (WBT)
775 3389/tcp Microsoft Terminal Server (RDP) officially registered as Windows Based Terminal (WBT)
776 3396/udp Novell NDPS Printer Agent
777 3396/tcp Novell NDPS Printer Agent
778 3412/udp xmlBlaster
779 3412/tcp xmlBlaster
780 3455/udp Resource Reservation Protocol (RSVP)
781 3455/tcp Resource Reservation Protocol (RSVP)
782 3478/udp STUN, a protocol for NAT traversal
783 3478/tcp STUN, a protocol for NAT traversal
784 3478/udp TURN, a protocol for NAT traversal (extension to STUN)
785 3478/tcp TURN, a protocol for NAT traversal (extension to STUN)
786 3478/udp STUN Behavior Discovery. See also port 5349.
787 3478/tcp STUN Behavior Discovery. See also port 5349.
788 3493/udp Network UPS Tools (NUT)
789 3493/tcp Network UPS Tools (NUT)
790 3516/udp Smartcard Port
791 3516/tcp Smartcard Port
792 3645/udp Cyc
793 3645/tcp Cyc
794 3659/udp Apple SASL, used by Mac OS X Server Password Server
795 3659/tcp Apple SASL, used by Mac OS X Server Password Server
796 3667/udp Information Exchange
797 3667/tcp Information Exchange
798 3690/udp Subversion (SVN) version control system
799 3690/tcp Subversion (SVN) version control system
800 3702/udp Web Services Dynamic Discovery (WS-Discovery), used by various components of Windows Vista and later
801 3702/tcp Web Services Dynamic Discovery (WS-Discovery), used by various components of Windows Vista and later
802 3724/udp Some Blizzard games
803 3724/tcp Some Blizzard games
804 3725/udp Netia NA-ER Port
805 3725/tcp Netia NA-ER Port
806 3768/udp RBLcheckd server daemon
807 3768/tcp RBLcheckd server daemon
808 3804/udp Harman Professional HiQnet protocol
809 3804/tcp Harman Professional HiQnet protocol
810 3826/udp WarMUX game server
811 3826/tcp WarMUX game server
812 3830/udp System Management Agent, developed and used by Cerner to monitor and manage solutions
813 3830/tcp System Management Agent, developed and used by Cerner to monitor and manage solutions
814 3880/udp IGRS
815 3880/tcp IGRS
816 3999/udp Norman distributed scanning service
817 3999/tcp Norman distributed scanning service
818 4018/udp Protocol information and warnings
819 4018/tcp Protocol information and warnings
820 4089/udp OpenCORE Remote Control Service
821 4089/tcp OpenCORE Remote Control Service
822 4090/udp Kerio
823 4090/tcp Kerio
824 4093/udp PxPlus Client server interface ProvideX
825 4093/tcp PxPlus Client server interface ProvideX
826 4096/udp Ascom Timeplex Bridge Relay Element (BRE)
827 4096/tcp Ascom Timeplex Bridge Relay Element (BRE)
828 4105/udp Shofar (ShofarNexus)
829 4105/tcp Shofar (ShofarNexus)
830 4116/udp Smartcard-TLS
831 4116/tcp Smartcard-TLS
832 4172/udp Teradici PCoIP
833 4172/tcp Teradici PCoIP
834 4303/udp Simple Railroad Command Protocol (SRCP)
835 4303/tcp Simple Railroad Command Protocol (SRCP)
836 4486/udp Integrated Client Message Service (ICMS)
837 4486/tcp Integrated Client Message Service (ICMS)
838 4500/udp IPSec NAT Traversal (RFC 3947, RFC 4306)
839 4500/assigned IPSec NAT Traversal (RFC 3947, RFC 4306)
840 4662/udp OrbitNet Message Service
841 4662/tcp OrbitNet Message Service
842 4730/udp Gearman's job server
843 4730/tcp Gearman's job server
844 4739/udp IP Flow Information Export
845 4739/tcp IP Flow Information Export
846 4753/udp SIMON (service and discovery)
847 4753/tcp SIMON (service and discovery)
848 4840/udp OPC UA Connection Protocol (TCP) and OPC UA Multicast Datagram Protocol (UDP) for OPC Unified Architecture from OPC Foundation
849 4840/tcp OPC UA Connection Protocol (TCP) and OPC UA Multicast Datagram Protocol (UDP) for OPC Unified Architecture from OPC Foundation
850 4843/udp OPC UA TCP Protocol over TLS/SSL for OPC Unified Architecture from OPC Foundation
851 4843/tcp OPC UA TCP Protocol over TLS/SSL for OPC Unified Architecture from OPC Foundation
852 4847/udp Web Fresh Communication, Quadrion Software & Odorless Entertainment
853 4847/tcp Web Fresh Communication, Quadrion Software & Odorless Entertainment
854 4894/udp LysKOM Protocol A
855 4894/tcp LysKOM Protocol A
856 4950/udp Cylon Controls UC32 Communications Port
857 4950/tcp Cylon Controls UC32 Communications Port
858 5010/udp Registered to: TelePath (the IBM FlowMark workflow-management system messaging platform). The TCP port is now used for: IBM WebSphere MQ Workflow
859 5010/tcp Registered to: TelePath (the IBM FlowMark workflow-management system messaging platform). The TCP port is now used for: IBM WebSphere MQ Workflow
860 5011/udp TelePath (the IBM FlowMark workflow-management system messaging platform)
861 5011/tcp TelePath (the IBM FlowMark workflow-management system messaging platform)
862 5025/udp scpi-raw Standard Commands for Programmable Instruments
863 5025/tcp scpi-raw Standard Commands for Programmable Instruments
864 5060/udp Session Initiation Protocol (SIP)
865 5060/tcp Session Initiation Protocol (SIP)
866 5062/udp Localisation access
867 5062/tcp Localisation access
868 5064/udp EPICS Channel Access server
869 5064/tcp EPICS Channel Access server
870 5065/udp EPICS Channel Access repeater beacon
871 5065/tcp EPICS Channel Access repeater beacon
872 5084/udp EPCglobal Low Level Reader Protocol (LLRP)
873 5084/tcp EPCglobal Low Level Reader Protocol (LLRP)
874 5085/udp EPCglobal Low Level Reader Protocol (LLRP) over TLS
875 5085/tcp EPCglobal Low Level Reader Protocol (LLRP) over TLS
876 5099/udp SafeNet, Inc Sentinel LM, Sentinel RMS, License Manager, server-to-server
877 5099/tcp SafeNet, Inc Sentinel LM, Sentinel RMS, License Manager, server-to-server
878 5150/udp ATMP Ascend Tunnel Management Protocol
879 5150/tcp ATMP Ascend Tunnel Management Protocol
880 5154/udp BZFlag
881 5154/tcp BZFlag
882 5190/udp AOL Instant Messenger protocol. The chat app is defunct as of 15 December 2017.
883 5190/tcp AOL Instant Messenger protocol. The chat app is defunct as of 15 December 2017.
884 5298/udp Extensible Messaging and Presence Protocol (XMPP)
885 5298/tcp Extensible Messaging and Presence Protocol (XMPP)
886 5310/udp Outlaws (1997 video game). Both UDP and TCP are reserved, but only UDP is used
887 5310/tcp Outlaws (1997 video game). Both UDP and TCP are reserved, but only UDP is used
888 5353/udp Multicast DNS (mDNS)
889 5353/assigned Multicast DNS (mDNS)
890 5355/udp Link-Local Multicast Name Resolution (LLMNR), allows hosts to perform name resolution for hosts on the same local link (only provided by Windows Vista and Server 2008)
891 5355/tcp Link-Local Multicast Name Resolution (LLMNR), allows hosts to perform name resolution for hosts on the same local link (only provided by Windows Vista and Server 2008)
892 5402/udp Multicast File Transfer Protocol (MFTP)
893 5402/tcp Multicast File Transfer Protocol (MFTP)
894 5405/udp NetSupport Manager
895 5405/tcp NetSupport Manager
896 5412/udp IBM Rational Synergy (Telelogic Synergy) (Continuus CM) Message Router
897 5412/tcp IBM Rational Synergy (Telelogic Synergy) (Continuus CM) Message Router
898 5413/udp Wonderware SuiteLink service
899 5413/tcp Wonderware SuiteLink service
900 5417/udp SNS Agent
901 5417/tcp SNS Agent
902 5421/udp NetSupport Manager
903 5421/tcp NetSupport Manager
904 5556/udp Freeciv, Oracle WebLogic Server Node Manager
905 5556/tcp Freeciv, Oracle WebLogic Server Node Manager
906 5568/udp Session Data Transport (SDT), a part of Architecture for Control Networks (ACN)
907 5568/tcp Session Data Transport (SDT), a part of Architecture for Control Networks (ACN)
908 5722/udp Microsoft RPC, DFSR (SYSVOL) Replication Service
909 5722/tcp Microsoft RPC, DFSR (SYSVOL) Replication Service
910 5741/udp IDA Discover Port 1
911 5741/tcp IDA Discover Port 1
912 5742/udp IDA Discover Port 2
913 5742/tcp IDA Discover Port 2
914 5900/udp Remote Frame Buffer protocol (RFB)
915 5900/tcp Remote Frame Buffer protocol (RFB)
916 5931/udp AMMYY admin Remote Control
917 5931/tcp AMMYY admin Remote Control
918 5984/udp CouchDB database server
919 5984/tcp CouchDB database server
920 6000/udp X11-used between an X client and server over the network
921 6000/tcp X11-used between an X client and server over the network
922 6001/udp X11-used between an X client and server over the network
923 6001/tcp X11-used between an X client and server over the network
924 6002/udp X11-used between an X client and server over the network
925 6002/tcp X11-used between an X client and server over the network
926 6003/udp X11-used between an X client and server over the network
927 6003/tcp X11-used between an X client and server over the network
928 6004/udp X11-used between an X client and server over the network
929 6004/tcp X11-used between an X client and server over the network
930 6005/udp X11-used between an X client and server over the network
931 6005/tcp X11-used between an X client and server over the network
932 6006/udp X11-used between an X client and server over the network
933 6006/tcp X11-used between an X client and server over the network
934 6007/udp X11-used between an X client and server over the network
935 6007/tcp X11-used between an X client and server over the network
936 6008/udp X11-used between an X client and server over the network
937 6008/tcp X11-used between an X client and server over the network
938 6009/udp X11-used between an X client and server over the network
939 6009/tcp X11-used between an X client and server over the network
940 6010/udp X11-used between an X client and server over the network
941 6010/tcp X11-used between an X client and server over the network
942 6011/udp X11-used between an X client and server over the network
943 6011/tcp X11-used between an X client and server over the network
944 6012/udp X11-used between an X client and server over the network
945 6012/tcp X11-used between an X client and server over the network
946 6013/udp X11-used between an X client and server over the network
947 6013/tcp X11-used between an X client and server over the network
948 6014/udp X11-used between an X client and server over the network
949 6014/tcp X11-used between an X client and server over the network
950 6015/udp X11-used between an X client and server over the network
951 6015/tcp X11-used between an X client and server over the network
952 6016/udp X11-used between an X client and server over the network
953 6016/tcp X11-used between an X client and server over the network
954 6017/udp X11-used between an X client and server over the network
955 6017/tcp X11-used between an X client and server over the network
956 6018/udp X11-used between an X client and server over the network
957 6018/tcp X11-used between an X client and server over the network
958 6019/udp X11-used between an X client and server over the network
959 6019/tcp X11-used between an X client and server over the network
960 6020/udp X11-used between an X client and server over the network
961 6020/tcp X11-used between an X client and server over the network
962 6021/udp X11-used between an X client and server over the network
963 6021/tcp X11-used between an X client and server over the network
964 6022/udp X11-used between an X client and server over the network
965 6022/tcp X11-used between an X client and server over the network
966 6023/udp X11-used between an X client and server over the network
967 6023/tcp X11-used between an X client and server over the network
968 6024/udp X11-used between an X client and server over the network
969 6024/tcp X11-used between an X client and server over the network
970 6025/udp X11-used between an X client and server over the network
971 6025/tcp X11-used between an X client and server over the network
972 6026/udp X11-used between an X client and server over the network
973 6026/tcp X11-used between an X client and server over the network
974 6027/udp X11-used between an X client and server over the network
975 6027/tcp X11-used between an X client and server over the network
976 6028/udp X11-used between an X client and server over the network
977 6028/tcp X11-used between an X client and server over the network
978 6029/udp X11-used between an X client and server over the network
979 6029/tcp X11-used between an X client and server over the network
980 6030/udp X11-used between an X client and server over the network
981 6030/tcp X11-used between an X client and server over the network
982 6031/udp X11-used between an X client and server over the network
983 6031/tcp X11-used between an X client and server over the network
984 6032/udp X11-used between an X client and server over the network
985 6032/tcp X11-used between an X client and server over the network
986 6033/udp X11-used between an X client and server over the network
987 6033/tcp X11-used between an X client and server over the network
988 6034/udp X11-used between an X client and server over the network
989 6034/tcp X11-used between an X client and server over the network
990 6035/udp X11-used between an X client and server over the network
991 6035/tcp X11-used between an X client and server over the network
992 6036/udp X11-used between an X client and server over the network
993 6036/tcp X11-used between an X client and server over the network
994 6037/udp X11-used between an X client and server over the network
995 6037/tcp X11-used between an X client and server over the network
996 6038/udp X11-used between an X client and server over the network
997 6038/tcp X11-used between an X client and server over the network
998 6039/udp X11-used between an X client and server over the network
999 6039/tcp X11-used between an X client and server over the network
1000 6040/udp X11-used between an X client and server over the network
1001 6040/tcp X11-used between an X client and server over the network
1002 6041/udp X11-used between an X client and server over the network
1003 6041/tcp X11-used between an X client and server over the network
1004 6042/udp X11-used between an X client and server over the network
1005 6042/tcp X11-used between an X client and server over the network
1006 6043/udp X11-used between an X client and server over the network
1007 6043/tcp X11-used between an X client and server over the network
1008 6044/udp X11-used between an X client and server over the network
1009 6044/tcp X11-used between an X client and server over the network
1010 6045/udp X11-used between an X client and server over the network
1011 6045/tcp X11-used between an X client and server over the network
1012 6046/udp X11-used between an X client and server over the network
1013 6046/tcp X11-used between an X client and server over the network
1014 6047/udp X11-used between an X client and server over the network
1015 6047/tcp X11-used between an X client and server over the network
1016 6048/udp X11-used between an X client and server over the network
1017 6048/tcp X11-used between an X client and server over the network
1018 6049/udp X11-used between an X client and server over the network
1019 6049/tcp X11-used between an X client and server over the network
1020 6050/udp X11-used between an X client and server over the network
1021 6050/tcp X11-used between an X client and server over the network
1022 6051/udp X11-used between an X client and server over the network
1023 6051/tcp X11-used between an X client and server over the network
1024 6052/udp X11-used between an X client and server over the network
1025 6052/tcp X11-used between an X client and server over the network
1026 6053/udp X11-used between an X client and server over the network
1027 6053/tcp X11-used between an X client and server over the network
1028 6054/udp X11-used between an X client and server over the network
1029 6054/tcp X11-used between an X client and server over the network
1030 6055/udp X11-used between an X client and server over the network
1031 6055/tcp X11-used between an X client and server over the network
1032 6056/udp X11-used between an X client and server over the network
1033 6056/tcp X11-used between an X client and server over the network
1034 6057/udp X11-used between an X client and server over the network
1035 6057/tcp X11-used between an X client and server over the network
1036 6058/udp X11-used between an X client and server over the network
1037 6058/tcp X11-used between an X client and server over the network
1038 6059/udp X11-used between an X client and server over the network
1039 6059/tcp X11-used between an X client and server over the network
1040 6060/udp X11-used between an X client and server over the network
1041 6060/tcp X11-used between an X client and server over the network
1042 6061/udp X11-used between an X client and server over the network
1043 6061/tcp X11-used between an X client and server over the network
1044 6062/udp X11-used between an X client and server over the network
1045 6062/tcp X11-used between an X client and server over the network
1046 6063/udp X11-used between an X client and server over the network
1047 6063/tcp X11-used between an X client and server over the network
1048 6110/udp softcm, HP Softbench CM
1049 6110/tcp softcm, HP Softbench CM
1050 6111/udp spc, HP Softbench Sub-Process Control
1051 6111/tcp spc, HP Softbench Sub-Process Control
1052 6112/udp dtspcd, execute commands and launch applications remotely
1053 6112/tcp dtspcd, execute commands and launch applications remotely
1054 6346/udp gnutella-svc, gnutella (FrostWire, Limewire, Shareaza, etc.)
1055 6346/tcp gnutella-svc, gnutella (FrostWire, Limewire, Shareaza, etc.)
1056 6347/udp gnutella-rtr, Gnutella alternate
1057 6347/tcp gnutella-rtr, Gnutella alternate
1058 6350/udp App Discovery and Access Protocol
1059 6350/tcp App Discovery and Access Protocol
1060 6444/udp Sun Grid Engine Qmaster Service
1061 6444/tcp Sun Grid Engine Qmaster Service
1062 6445/udp Sun Grid Engine Execution Service
1063 6445/tcp Sun Grid Engine Execution Service
1064 6464/udp Port assignment for medical device communication in accordance to IEEE 11073-20701
1065 6464/tcp Port assignment for medical device communication in accordance to IEEE 11073-20701
1066 6515/udp Elipse RPC Protocol (REC)
1067 6515/tcp Elipse RPC Protocol (REC)
1068 6619/udp odette-ftps, Odette File Transfer Protocol (OFTP) over TLS/SSL
1069 6619/tcp odette-ftps, Odette File Transfer Protocol (OFTP) over TLS/SSL
1070 6622/udp Multicast FTP
1071 6622/tcp Multicast FTP
1072 6679/udp Osorno Automation Protocol (OSAUT)
1073 6679/tcp Osorno Automation Protocol (OSAUT)
1074 6888/udp MUSE
1075 6888/tcp MUSE
1076 6969/udp acmsoda
1077 6969/tcp acmsoda
1078 7262/udp CNAP (Calypso Network Access Protocol)
1079 7262/tcp CNAP (Calypso Network Access Protocol)
1080 7272/udp WatchMe - WatchMe Monitoring
1081 7272/tcp WatchMe - WatchMe Monitoring
1082 7400/udp RTPS (Real Time Publish Subscribe) DDS Discovery
1083 7400/tcp RTPS (Real Time Publish Subscribe) DDS Discovery
1084 7401/udp RTPS (Real Time Publish Subscribe) DDS User-Traffic
1085 7401/tcp RTPS (Real Time Publish Subscribe) DDS User-Traffic
1086 7402/udp RTPS (Real Time Publish Subscribe) DDS Meta-Traffic
1087 7402/tcp RTPS (Real Time Publish Subscribe) DDS Meta-Traffic
1088 7542/udp Saratoga file transfer protocol
1089 7542/tcp Saratoga file transfer protocol
1090 7547/udp CPE WAN Management Protocol (CWMP) Technical Report 069
1091 7547/tcp CPE WAN Management Protocol (CWMP) Technical Report 069
1092 7624/udp Instrument Neutral Distributed Interface
1093 7624/tcp Instrument Neutral Distributed Interface
1094 8008/udp Alternative port for HTTP. See also ports 80 and 8080.
1095 8008/tcp Alternative port for HTTP. See also ports 80 and 8080.
1096 8074/udp Gadu-Gadu
1097 8074/tcp Gadu-Gadu
1098 8080/udp Alternative port for HTTP. See also ports 80 and 8008.
1099 8080/tcp Alternative port for HTTP. See also ports 80 and 8008.
1100 8243/udp HTTPS listener for Apache Synapse
1101 8243/tcp HTTPS listener for Apache Synapse
1102 8280/udp HTTP listener for Apache Synapse
1103 8280/tcp HTTP listener for Apache Synapse
1104 8883/udp Secure MQTT (MQTT over TLS)
1105 8883/tcp Secure MQTT (MQTT over TLS)
1106 9001/udp ETL Service Manager
1107 9001/tcp ETL Service Manager
1108 9080/udp glrpc, Groove Collaboration software GLRPC
1109 9080/tcp glrpc, Groove Collaboration software GLRPC
1110 9101/udp Bacula Director
1111 9101/tcp Bacula Director
1112 9102/udp Bacula File Daemon
1113 9102/tcp Bacula File Daemon
1114 9103/udp Bacula Storage Daemon
1115 9103/tcp Bacula Storage Daemon
1116 9119/udp MXit Instant Messenger
1117 9119/tcp MXit Instant Messenger
1118 9389/udp adws, Microsoft AD DS Web Services, Powershell uses this port
1119 9389/tcp adws, Microsoft AD DS Web Services, Powershell uses this port
1120 9418/udp git, Git pack transfer service
1121 9418/tcp git, Git pack transfer service
1122 9535/udp mngsuite, LANDesk Management Suite Remote Control
1123 9535/tcp mngsuite, LANDesk Management Suite Remote Control
1124 9536/udp laes-bf, IP Fabrics Surveillance buffering function
1125 9536/tcp laes-bf, IP Fabrics Surveillance buffering function
1126 9800/udp WebDAV Source
1127 9800/tcp WebDAV Source
1128 10000/udp Network Data Management Protocol
1129 10000/tcp Network Data Management Protocol
1130 10050/udp Zabbix agent
1131 10050/tcp Zabbix agent
1132 10051/udp Zabbix trapper
1133 10051/tcp Zabbix trapper
1134 10110/udp NMEA 0183 Navigational Data. Transport of NMEA 0183 sentences over TCP or UDP
1135 10110/tcp NMEA 0183 Navigational Data. Transport of NMEA 0183 sentences over TCP or UDP
1136 11001/udp metasys ( Johnson Controls Metasys java AC control environment )
1137 11001/tcp metasys ( Johnson Controls Metasys java AC control environment )
1138 11112/udp ACR/NEMA Digital Imaging and Communications in Medicine (DICOM)
1139 11112/tcp ACR/NEMA Digital Imaging and Communications in Medicine (DICOM)
1140 11371/udp OpenPGP HTTP key server
1141 11371/tcp OpenPGP HTTP key server
1142 13720/udp Symantec NetBackup—bprd (formerly VERITAS)
1143 13720/tcp Symantec NetBackup—bprd (formerly VERITAS)
1144 13721/udp Symantec NetBackup—bpdbm (formerly VERITAS)
1145 13721/tcp Symantec NetBackup—bpdbm (formerly VERITAS)
1146 13724/udp Symantec Network Utility—vnetd (formerly VERITAS)
1147 13724/tcp Symantec Network Utility—vnetd (formerly VERITAS)
1148 13782/udp Symantec NetBackup—bpcd (formerly VERITAS)
1149 13782/tcp Symantec NetBackup—bpcd (formerly VERITAS)
1150 13783/udp Symantec VOPIED protocol (formerly VERITAS)
1151 13783/tcp Symantec VOPIED protocol (formerly VERITAS)
1152 13785/udp Symantec NetBackup Database—nbdb (formerly VERITAS)
1153 13785/tcp Symantec NetBackup Database—nbdb (formerly VERITAS)
1154 13786/udp Symantec nomdb (formerly VERITAS)
1155 13786/tcp Symantec nomdb (formerly VERITAS)
1156 15345/udp XPilot Contact
1157 15345/tcp XPilot Contact
1158 17500/udp Dropbox LanSync Protocol (db-lsp); used to synchronize file catalogs between Dropbox clients on a local network.
1159 17500/tcp Dropbox LanSync Protocol (db-lsp); used to synchronize file catalogs between Dropbox clients on a local network.
1160 19813/udp 4D database Client Server Communication
1161 19813/tcp 4D database Client Server Communication
1162 24465/udp Tonido Directory Server for Tonido which is a Personal Web App and P2P platform
1163 24465/tcp Tonido Directory Server for Tonido which is a Personal Web App and P2P platform
1164 24554/udp BINKP, Fidonet mail transfers over TCP/IP
1165 24554/tcp BINKP, Fidonet mail transfers over TCP/IP
1166 26000/udp id Software's Quake server
1167 26000/tcp id Software's Quake server
1168 27000/udp FlexNet Publisher's License server (from the range of default ports)
1169 27000/tcp FlexNet Publisher's License server (from the range of default ports)
1170 27001/udp FlexNet Publisher's License server (from the range of default ports)
1171 27001/tcp FlexNet Publisher's License server (from the range of default ports)
1172 27002/udp FlexNet Publisher's License server (from the range of default ports)
1173 27002/tcp FlexNet Publisher's License server (from the range of default ports)
1174 27003/udp FlexNet Publisher's License server (from the range of default ports)
1175 27003/tcp FlexNet Publisher's License server (from the range of default ports)
1176 27004/udp FlexNet Publisher's License server (from the range of default ports)
1177 27004/tcp FlexNet Publisher's License server (from the range of default ports)
1178 27005/udp FlexNet Publisher's License server (from the range of default ports)
1179 27005/tcp FlexNet Publisher's License server (from the range of default ports)
1180 27006/udp FlexNet Publisher's License server (from the range of default ports)
1181 27006/tcp FlexNet Publisher's License server (from the range of default ports)
1182 27007/udp FlexNet Publisher's License server (from the range of default ports)
1183 27007/tcp FlexNet Publisher's License server (from the range of default ports)
1184 27008/udp FlexNet Publisher's License server (from the range of default ports)
1185 27008/tcp FlexNet Publisher's License server (from the range of default ports)
1186 27009/udp FlexNet Publisher's License server (from the range of default ports)
1187 27009/tcp FlexNet Publisher's License server (from the range of default ports)
1188 33434/udp traceroute
1189 33434/tcp traceroute
1190 40000/udp SafetyNET p – a real-time Industrial Ethernet protocol
1191 40000/tcp SafetyNET p – a real-time Industrial Ethernet protocol
1192 44818/udp EtherNet/IP explicit messaging
1193 44818/tcp EtherNet/IP explicit messaging
1194 47808/udp BACnet Building Automation and Control Networks (4780810 = BAC016)
1195 47808/tcp BACnet Building Automation and Control Networks (4780810 = BAC016)
1196 49151/udp Reserved
1197 49151/tcp Reserved
623623 self.path = urlComponents.path
624624 self.params = urlComponents.query
625625
626 self.url = self.protocol + "://" + self.hostname + ":" + self.port + self.path
626 self.url = self.protocol + "://" + self.hostname + ":" + int(self.port) + self.path
627627 self.fullpath = self.url + "?" + self.params
628628
629629 self._output_path = "%s%s" % (
11 autobahn>=17.10.1
22 colorama>=0.3.9
33 deprecation>=1.0.1
4 flask>=0.12.2
4 flask>=1.0
55 IPy>=0.83
66 mockito>=1.0.12
77 pgcli>=1.8.2
33 responses>=0.9.0
44 hypothesis>=3.48.0
55 beautifulsoup4>=4.6.0
6 Sphinx>=1.7.6
00 beautifulsoup4>=4.6.0
1 psycopg2>=2.7.3
21 w3af_api_client>=1.1.7
32 selenium>=3.9.0
00 autobahn>=17.10.1
1 alembic==0.9.9
1 alembic>=0.9.9
22 bcrypt>=3.1.4
33 couchdbkit>=0.6.5
44 colorama>=0.3.9
5 click>=5.1
56 Flask-SQLAlchemy>=2.3.1
67 flask-classful>=0.14
78 Flask-Security>=3.0.0
89 flask-session>=0.3.1
9 flask<1.0
10 flask>=1.0
1011 IPy>=0.83
11 marshmallow==2.15.3
12 marshmallow>=2.15.3
1213 Pillow>=4.2.1
13 psycopg2>=2.7.3.2
14 psycopg2>=2.7.1
1415 pyasn1-modules>=0.0.11
1516 pyopenssl>=17.2.0
1617 python-dateutil>=2.6.0
2122 SQLAlchemy>=1.2.0b2
2223 sqlalchemy_schemadisplay>=1.3
2324 tqdm>=4.15.0
24 twisted>=17.5.0
25 twisted>=18.7.0
2526 webargs>=3.0.0
2627 marshmallow-sqlalchemy
2728 git+https://github.com/infobyte/filteralchemy@dev#egg=filteralchemy
6060
6161 # TODO: Require @view decorator to enable custom routes
6262 class GenericView(FlaskView):
63 """Abstract class to provide helpers. Inspired in Django REST
64 Framework generic viewsets"""
63 """Abstract class to provide generic views. Inspired in `Django REST
64 Framework generic viewsets`_.
65
66 To create new views, you should create a class inheriting from
67 GenericView (or from one of its subclasses) and set the model_class,
68 schema_class, and optionally the rest of class attributes.
69
70 Then, you should register it with your app by using the ``register``
71 classmethod.
72
73 .. _Django REST Framework generic viewsets: http://www.django-rest-framework.org/api-guide/viewsets/#genericviewset
74 """
6575
6676 # Must-implement attributes
77
78 #: **Required**. The class of the SQLAlchemy model this view will handle
6779 model_class = None
80
81 #: **Required** (unless _get_schema_class is overwritten).
82 #: A subclass of `marshmallow.Schema` to serialize and deserialize the
83 #: data provided by the user
6884 schema_class = None
6985
7086 # Default attributes
87
88 #: The prefix where the endpoint should be registered.
89 #: This is useful for API versioning
7190 route_prefix = '/v2/'
91
92 #: Arguments that are passed to the view but shouldn't change the route
93 #: rule. This should be used when route_prefix is parametrized
94 #:
95 #: You tipically won't need this, unless you're creating nested views.
96 #: For example GenericWorkspacedView use this so the workspace name is
97 #: prepended to the view URL
7298 base_args = []
99
100 #: Decides how you want to format the output response. It is set to dump a
101 #: JSON object by default.
102 #: See http://flask-classful.teracy.org/#adding-resource-representations-get-real-classy-and-put-on-a-top-hat
103 #: for more information
73104 representations = {
74105 'application/json': output_json,
75106 'flask-classful/default': output_json,
76107 }
108
109 ""
110 #: Name of the field of the model used to get the object instance in
111 #: retrieve, update and delete endpoints.
112 #:
113 #: For example, if you have a `Tag` model, maybe a `slug` would be good
114 #: lookup field.
115 #:
116 #: .. note::
117 #: You must use a unique field here instead of one allowing
118 #: duplicate values
119 #:
120 #: .. note::
121 #: By default the lookup field value must be a valid integer. If you
122 #: want to allow any string, like with the slug field, make sure that
123 #: you set lookup_field_type to `string`
77124 lookup_field = 'id'
125
126 #: A function that converts the string paremeter passed in the URL to the
127 #: value that will be queried in the database.
128 #: It defaults to int to match the type of the default lookup_field_type
129 #: (id)
78130 lookup_field_type = int
79131
80132 # Attributes to improve the performance of list and retrieve views
133
134 #: List of relationships to eagerload in list and retrieve views.
135 #:
136 #: This is useful when you when you want to retrieve all childrens
137 #: of an object in an API response, like for example if you want
138 #: to have all hostnames of each host in the hosts endpoint.
81139 get_joinedloads = [] # List of relationships to eagerload
140
141 #: List of columns that will be loaded directly when performing an
142 #: eagerloaded query.
143 #:
144 #: This is useful when you have a column that is typically deferred because
145 #: typically is isn't used, like the vuln creator. If you know you will use
146 #: it, indicate it here to prevent doing an extra SQL query.
82147 get_undefer = [] # List of columns to undefer
83148
84149 def _get_schema_class(self):
150 """By default, it returns ``self.schema_class``.
151
152 You can override it to define a custom behavior to be used
153 in all views.
154 """
85155 assert self.schema_class is not None, "You must define schema_class"
86156 return self.schema_class
87157
108178 return context
109179
110180 def _get_lookup_field(self):
181 """Get a Field instance based on ``self.model_class`` and
182 ``self.lookup_field``
183 """
111184 return getattr(self.model_class, self.lookup_field)
112185
113186 def _validate_object_id(self, object_id):
187 """
188 By default, it validates the value of the lookup field set by the user
189 in the URL by calling ``self.lookup_field_type(object_id)``.
190 If that raises a ValueError, que view will fail with error
191 code 404.
192 """
114193 try:
115194 self.lookup_field_type(object_id)
116195 except ValueError:
117196 flask.abort(404, 'Invalid format of lookup field')
118197
119198 def _get_base_query(self):
199 """Return the initial query all views should use
200
201 .. warning::
202 When you are creating views, avoid making SQL queries that
203 don't inherit from this base query. You could easily forget
204 to add workspace permission checks and similar stuff.
205 """
120206 query = self.model_class.query
121207 return query
122208
123209 def _get_eagerloaded_query(self, *args, **kwargs):
210 """Load objects related to the current model in a single query.
211
212 This is useful to prevent n+1 SQL problems, where a request to an
213 object with many childs makes many SQL requests that tends to be
214 slow.
215
216 You tipically won't need to overwrite this method, but to set
217 get_joinedloads and get_undefer attributes that are used by
218 this method.
219
220 In really complex cases where good performance is required,
221 like in the vulns API endpoint, you will have to overwrite this.
222 """
124223 options = []
125224 try:
126225 has_creator = 'owner' in self._get_schema_class().opts.fields
139238 return query.options(*options)
140239
141240 def _filter_query(self, query):
142 """Return a new SQLAlchemy query with some filters applied"""
241 """Return a new SQLAlchemy query with some filters applied.
242
243 By default it doesn't do anything. It is overriden by
244 :class:`FilterAlchemyMixin` to give support to Filteralchemy
245 filters.
246
247 .. warning::
248 This is only used by the list endpoints. Don't use this
249 to restrict the user the access for certain elements (like
250 for example to restrict the items to one workspace). For
251 this you must override _get_base_query instead.
252
253 Always think that this filtering is optional, just a
254 feature for the user to only see items he/she is interested
255 in, so it is the user who will filter the data, not you
256
257 """
143258 return query
144259
145260 def _get_object(self, object_id, eagerload=False, **kwargs):
261 """
262 Given the object_id and extra route params, get an instance of
263 ``self.model_class``
264 """
146265 self._validate_object_id(object_id)
147266 if eagerload:
148267 query = self._get_eagerloaded_query(**kwargs)
155274 return obj
156275
157276 def _dump(self, obj, route_kwargs, **kwargs):
277 """Serializes an object with the Marshmallow schema class
278 returned by ``self._get_schema_class()``. Any passed kwargs
279 will be passed to the ``__init__`` method of the schema.
280
281 TODO migration: document route_kwargs
282 """
158283 try:
159284 return self._get_schema_instance(route_kwargs, **kwargs).dump(obj).data
160285 except ObjectDeletedError:
161286 return []
162287
163288 def _parse_data(self, schema, request, *args, **kwargs):
289 """Deserializes from a Flask request to a dict with valid
290 data. It a ``Marshmallow.Schema`` instance to perform the
291 deserialization
292 """
164293 return FlaskParser().parse(schema, request, locations=('json',),
165294 *args, **kwargs)
166295
203332
204333 class GenericWorkspacedView(GenericView):
205334 """Abstract class for a view that depends on the workspace, that is
206 passed in the URL"""
335 passed in the URL
336
337 .. note::
338 This view inherits from GenericView, so make sure you understand
339 that first by checking the docs above, or just by looking at the
340 source code of server/api/base.py.
341
342 """
207343
208344 # Default attributes
209345 route_prefix = '/v2/ws/<workspace_name>/'
248384
249385 def _envelope_list(self, objects, pagination_metadata=None):
250386 """Override this method to define how a list of objects is
251 rendered"""
387 rendered.
388
389 See the example of :ref:`envelope-list-example` to learn
390 when and how it should be used.
391 """
252392 return objects
253393
254394 def _paginate(self, query):
395 """Overwrite this to implement pagination in the list endpoint.
396
397 This is typically overwritten by SortableMixin.
398
399 The method takes a query as argument and should return a tuple
400 containing a new filtered query and a "pagination metadata"
401 object that will be used by _envelope_list. If you don't need
402 the latter just set is as None.
403 """
255404 return query, None
256405
257406 def _get_order_field(self, **kwargs):
258 """Override this to enable custom sorting"""
407 """Return the field used to sort the query.
408
409 By default it returns the value of self.order_field, but it
410 can be overwritten to something else, as SortableMixin does.
411 """
259412 return self.order_field
260413
261414 def index(self, **kwargs):
269422
270423
271424 class SortableMixin(object):
272 """Enables custom sorting by a field specified by te user"""
425 """Enables custom sorting by a field specified by the user
426
427 See the example of :ref:`pagination-and-sorting-recipe` to learn
428 how is it used.
429
430 Works for both workspaced and non-workspaced views.
431 """
273432 sort_field_paremeter_name = "sort"
274433 sort_direction_paremeter_name = "sort_dir"
275434 sort_pass_silently = False
386545
387546
388547 class ListWorkspacedMixin(ListMixin):
389 """Add GET /<workspace_name>/ route"""
548 """Add GET /<workspace_name>/<route_base>/ route"""
390549 # There are no differences with the non-workspaced implementations. The code
391550 # inside the view generic methods is enough
392551 pass
401560
402561
403562 class RetrieveWorkspacedMixin(RetrieveMixin):
404 """Add GET /<workspace_name>/<id>/ route"""
563 """Add GET /<workspace_name>/<route_base>/<id>/ route"""
405564 # There are no differences with the non-workspaced implementations. The code
406565 # inside the view generic methods is enough
407566 pass
411570 ListMixin,
412571 RetrieveMixin,
413572 GenericView):
414 """A generic view with list and retrieve endpoints"""
573 """A generic view with list and retrieve endpoints
574
575 It is just a GenericView inheriting also from ListMixin,
576 RetrieveMixin and SortableMixin.
577 """
415578 pass
416579
417580
419582 ListWorkspacedMixin,
420583 RetrieveWorkspacedMixin,
421584 GenericWorkspacedView):
422 """A workspaced generic view with list and retrieve endpoints"""
585 """A workspaced generic view with list and retrieve endpoints
586
587 It is just a GenericWorkspacedView inheriting also from
588 ListWorkspacedMixin, RetrieveWorkspacedMixin and SortableMixin"""
423589 pass
424590
425591
438604 return self._dump(created, kwargs), 201
439605
440606 def _perform_create(self, data, **kwargs):
607 """Check for conflicts and create a new object
608
609 Is is passed the data parsed by the marshmallow schema (it
610 transform from raw post data to a JSON)
611 """
441612 obj = self.model_class(**data)
442613 # assert not db.session.new
443614 try:
505676
506677
507678 class CreateWorkspacedMixin(CreateMixin, CommandMixin):
508 """Add POST /<workspace_name>/ route"""
679 """Add POST /<workspace_name>/<route_base>/ route
680
681 If a GET parameter command_id is passed, it will create a new
682 CommandObject associated to that command to register the change in
683 the database.
684 """
509685
510686 def _perform_create(self, data, workspace_name):
511687 assert not db.session.new
538714
539715
540716 class UpdateMixin(object):
541 """Add PUT /<workspace_name>/<id>/ route"""
717 """Add PUT /<id>/ route"""
542718
543719 def put(self, object_id, **kwargs):
544720 obj = self._get_object(object_id, **kwargs)
553729 return self._dump(obj, kwargs), 200
554730
555731 def _update_object(self, obj, data):
732 """Perform changes in the selected object
733
734 It modifies the attributes of the SQLAlchemy model to match
735 the data passed by the Marshmallow schema.
736
737 It is common to overwrite this method to do something strange
738 with some specific field. Typically the new method should call
739 this one to handle the update of the rest of the fields.
740 """
556741 for (key, value) in data.items():
557742 setattr(obj, key, value)
558743
559744 def _perform_update(self, object_id, obj, data, workspace_name=None):
745 """Commit the SQLAlchemy session, check for updating conflicts"""
560746 try:
561747 db.session.add(obj)
562748 db.session.commit()
582768
583769
584770 class UpdateWorkspacedMixin(UpdateMixin, CommandMixin):
585 """Add PUT /<id>/ route"""
771 """Add PUT /<workspace_name>/<route_base>/<id>/ route
772
773 If a GET parameter command_id is passed, it will create a new
774 CommandObject associated to that command to register the change in
775 the database.
776 """
586777
587778 def _perform_update(self, object_id, obj, data, workspace_name):
588779 # # Make sure that if I created new objects, I had properly commited them
609800
610801
611802 class DeleteWorkspacedMixin(DeleteMixin):
612 """Add DELETE /<workspace_name>/<id>/ route"""
803 """Add DELETE /<workspace_name>/<route_base>/<id>/ route"""
613804 pass
614805
615806
616807 class CountWorkspacedMixin(object):
808 """Add GET /<workspace_name>/<route_base>/count/ route
809
810 Group objects by the field set in the group_by GET parameter. If it
811 isn't specified, the view will return a 404 error. For each group,
812 show the count of elements and its value.
813
814 This view is often used by some parts of the web UI. It was designed
815 to keep backwards compatibility with the count endpoint of Faraday
816 v2.
817 """
617818
618819 #: List of SQLAlchemy query filters to apply when counting
619820 count_extra_filters = []
660861 UpdateMixin,
661862 DeleteMixin,
662863 ReadOnlyView):
663 """A generic view with list, retrieve and create endpoints"""
864 """A generic view with list, retrieve and create endpoints
865
866 It is just a GenericView inheriting also from ListMixin,
867 RetrieveMixin, SortableMixin, CreateMixin, UpdateMixin and
868 DeleteMixin.
869 """
664870 pass
665871
666872
670876 CountWorkspacedMixin,
671877 ReadOnlyWorkspacedView):
672878 """A generic workspaced view with list, retrieve and create
673 endpoints"""
879 endpoints
880
881 It is just a GenericWorkspacedView inheriting also from
882 ListWorkspacedMixin, RetrieveWorkspacedMixin, SortableMixin,
883 CreateWorkspacedMixin, DeleteWorkspacedMixin and
884 CountWorkspacedMixin.
885 """
674886 pass
675887
676888
44 import flask
55 from flask import Blueprint
66 from flask_classful import route
7 from marshmallow import fields
7 from marshmallow import fields, Schema
88 from filteralchemy import Filter, FilterSet, operators
99
1010 from server.utils.database import get_or_create
8484 service = ServiceFilter(fields.Str())
8585
8686
87 class HostCountSchema(Schema):
88 host_id = fields.Integer(dump_only=True, allow_none=False,
89 attribute='id')
90 critical = fields.Integer(dump_only=True, allow_none=False,
91 attribute='vulnerability_critical_count')
92 high = fields.Integer(dump_only=True, allow_none=False,
93 attribute='vulnerability_high_count')
94 med = fields.Integer(dump_only=True, allow_none=False,
95 attribute='vulnerability_med_count')
96 info = fields.Integer(dump_only=True, allow_none=False,
97 attribute='vulnerability_info_count')
98 unclassified = fields.Integer(dump_only=True, allow_none=False,
99 attribute='vulnerability_unclassified_count')
100 total = fields.Integer(dump_only=True, allow_none=False,
101 attribute='vulnerability_total_count')
102
87103 class HostsView(PaginatedMixin,
88104 FilterAlchemyMixin,
89105 ReadWriteWorkspacedView):
101117 def service_list(self, workspace_name, host_id):
102118 services = self._get_object(host_id, workspace_name).services
103119 return ServiceSchema(many=True).dump(services).data
120
121 @route('/countVulns/')
122 def count_vulns(self, workspace_name):
123 host_ids = flask.request.args.get('hosts', None)
124 if host_ids:
125 host_id_list = host_ids.split(',')
126 else:
127 host_id_list = None
128
129 res_dict = {'hosts':{}}
130
131 host_count_schema = HostCountSchema()
132 host_count = Host.query_with_count(False, host_id_list, workspace_name)
133
134 for host in host_count.all():
135 res_dict["hosts"][host.id] = host_count_schema.dump(host).data
136 # return counts.data
137
138 return res_dict
104139
105140 def _perform_create(self, data, **kwargs):
106141 hostnames = data.pop('hostnames', [])
2727 @info_api.route('/config')
2828 def get_config():
2929 return flask.jsonify(gen_web_config())
30
31 get_config.is_public = True
1010 import string
1111 import random
1212 import logging
13 import model.api
13 import server.config as FaradayServerConfig
1414
1515 from flask import (
16 redirect,
1716 request,
1817 abort,
18 make_response,
1919 jsonify,
2020 Blueprint,
21 session,
22 make_response
2321 )
22
2423 from flask_wtf.csrf import validate_csrf
2524 from werkzeug.utils import secure_filename
2625 from wtforms import ValidationError
3635 from managers.mapper_manager import MapperManager
3736 from managers.reports_managers import ReportProcessor
3837
39 from server.models import User
4038 from persistence.server import server
4139
4240 from config.configuration import getInstanceConfiguration
4846 upload_api = Blueprint('upload_reports', __name__)
4947
5048
51
5249 class RawReportProcessor(Thread):
5350 def __init__(self):
5451
5552 super(RawReportProcessor, self).__init__()
5653 from faraday import setupPlugins
5754 setupPlugins()
55
5856 self.pending_actions = Queue()
5957
60 plugin_manager = PluginManager(os.path.join(CONF.getConfigPath(), "plugins"))
58 try:
59 plugin_manager = PluginManager(os.path.join(CONF.getConfigPath(), "plugins"))
60 except AttributeError:
61 get_logger().warning(
62 "Upload reports in WEB-UI not configurated, run Faraday client and try again...")
63 self._stop = True
64 return
65
6166 mappers_manager = MapperManager()
67
6268 self.model_controller = ModelController(mappers_manager, self.pending_actions)
6369 self.model_controller.start()
6470 self.end_event = Event()
71
6572 plugin_controller = PluginController(
6673 'PluginController',
6774 plugin_manager,
7986 def run(self):
8087 while not self._stop:
8188 try:
89
8290 workspace, file_path, cookie = UPLOAD_REPORTS_QUEUE.get(False, timeout=0.1)
8391 get_logger().info('Processing raw report {0}'.format(file_path))
8492
8593 # Cookie of user, used to create objects in server with the right owner.
8694 server.FARADAY_UPLOAD_REPORTS_WEB_COOKIE = cookie
95 server.FARADAY_UPLOAD_REPORTS_OVERWRITE_SERVER_URL = "http://{0}:{1}".format(
96 FaradayServerConfig.faraday_server.bind_address, FaradayServerConfig.faraday_server.port)
97
8798 self.processor.ws_name = workspace
99
88100 command_id = self.processor.processReport(file_path)
89101 UPLOAD_REPORTS_CMD_QUEUE.put(command_id)
90102 if not command_id:
91103 continue
104
92105 self.end_event.wait()
93106 get_logger().info('Report processing of report {0} finished'.format(file_path))
94107 self.end_event.clear()
108
95109 except Empty:
96110 time.sleep(0.1)
111
97112 except KeyboardInterrupt as ex:
98113 get_logger().info('Keyboard interrupt, stopping report processing thread')
99114 self.stop()
115
100116 except Exception as ex:
101117 get_logger().exception(ex)
102118 continue
129145 random_prefix = ''.join(random.choice(chars) for x in range(12))
130146 raw_report_filename = '{0}{1}'.format(random_prefix, secure_filename(report_file.filename))
131147
132 file_path = os.path.join(
133 CONF.getConfigPath(),
134 'uploaded_reports/{0}'.format(raw_report_filename))
148 try:
149 file_path = os.path.join(
150 CONF.getConfigPath(),
151 'uploaded_reports/{0}'.format(raw_report_filename))
152 except AttributeError:
153 get_logger().warning(
154 "Upload reports in WEB-UI not configurated, run Faraday client and try again...")
155 abort(make_response(jsonify(message="Upload reports not configurated: Run faraday client and start Faraday server again"), 500))
135156
136157 with open(file_path, 'w') as output:
137158 output.write(report_file.read())
138159
139160 UPLOAD_REPORTS_QUEUE.put((workspace, file_path, request.cookies))
140 return redirect('/#/dashboard/ws/' + workspace)
161 return make_response(jsonify(message="ok"), 200)
11 # Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)
22 # See the file 'doc/LICENSE' for the license information
33 import time
4 import threading
45
56 from flask import Blueprint
67 from filteralchemy import (
6869 operators = (operators.Equal,)
6970
7071
72 lock = threading.Lock()
73
74
7175 class VulnerabilityTemplateView(PaginatedMixin,
7276 FilterAlchemyMixin,
7377 ReadWriteView):
9094 'total_rows': len(objects)
9195 }
9296
97 def post(self, **kwargs):
98 with lock:
99 return super(VulnerabilityTemplateView, self).post(**kwargs)
100
93101
94102 VulnerabilityTemplateView.register(vulnerability_template_api)
286286
287287 class CreatorFilter(Filter):
288288 def filter(self, query, model, attr, value):
289 return query.filter(model.creator_command_tool == value)
289 return query.filter(model.creator_command_tool.ilike(
290 '%' + value + '%'))
290291
291292
292293 class ServiceFilter(Filter):
424425 # popped object has the expected type.
425426 # This will be set after setting the workspace
426427 attachments = data.pop('_attachments', {})
427 references = data.pop('references')
428 policyviolations = data.pop('policy_violations')
428 references = data.pop('references', [])
429 policyviolations = data.pop('policy_violations', [])
429430
430431 obj = super(VulnerabilityView, self)._perform_create(data, **kwargs)
431432 obj.references = references
574575 as_attachment=True,
575576 mimetype=depot_file.content_type
576577 )
577
578 else:
579 flask.abort(404, "File not found")
580 else:
581 flask.abort(404, "Vulnerability not found")
578582
579583 VulnerabilityView.register(vulns_api)
44
55 import os
66 import string
7 import datetime
78 from os.path import join, expanduser
89 from random import SystemRandom
910
2425 from flask_security import (
2526 Security,
2627 SQLAlchemyUserDatastore,
28 )
29 from flask_security.forms import LoginForm
30 from flask_security.utils import (
31 _datastore,
32 get_message,
33 verify_and_update_password
2734 )
2835 from flask_session import Session
2936 from nplusone.ext.flask_sqlalchemy import NPlusOne
155162 except Exception:
156163 save_new_secret_key(app)
157164
158 app.config['SECURITY_PASSWORD_SINGLE_HASH'] = True
159 app.config['WTF_CSRF_ENABLED'] = False
160 app.config['SECURITY_USER_IDENTITY_ATTRIBUTES'] = ['username']
161 app.config['SECURITY_POST_LOGIN_VIEW'] = '/_api/session'
162 app.config['SECURITY_POST_LOGOUT_VIEW'] = '/_api/login'
163 app.config['SECURITY_POST_CHANGE_VIEW'] = '/_api/change'
164 app.config['SECURITY_CHANGEABLE'] = True
165 app.config['SECURITY_SEND_PASSWORD_CHANGE_EMAIL'] = False
166
167 app.config['SESSION_TYPE'] = 'filesystem'
168 app.config['SESSION_FILE_DIR'] = server.config.FARADAY_SERVER_SESSIONS_DIR
169
170 app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
171 app.config['SQLALCHEMY_RECORD_QUERIES'] = True
172 # app.config['SQLALCHEMY_ECHO'] = True
173 app.config['SECURITY_PASSWORD_SCHEMES'] = [
174 'bcrypt', # This should be the default value
175 # 'des_crypt',
176 'pbkdf2_sha1', # Used by CouchDB passwords
177 # 'pbkdf2_sha256',
178 # 'pbkdf2_sha512',
179 # 'sha256_crypt',
180 # 'sha512_crypt',
181 'plaintext', # TODO: remove it
182 ]
165 login_failed_message = ("Invalid username or password", 'error')
166
167 app.config.update({
168 'SECURITY_PASSWORD_SINGLE_HASH': True,
169 'WTF_CSRF_ENABLED': False,
170 'SECURITY_USER_IDENTITY_ATTRIBUTES': ['username'],
171 'SECURITY_POST_LOGIN_VIEW': '/_api/session',
172 'SECURITY_POST_LOGOUT_VIEW': '/_api/login',
173 'SECURITY_POST_CHANGE_VIEW': '/_api/change',
174 'SECURITY_CHANGEABLE': True,
175 'SECURITY_SEND_PASSWORD_CHANGE_EMAIL': False,
176 'SECURITY_MSG_USER_DOES_NOT_EXIST': login_failed_message,
177
178 # The line bellow should not be necessary because of the
179 # CustomLoginForm, but i'll include it anyway.
180 'SECURITY_MSG_INVALID_PASSWORD': login_failed_message,
181
182 'SESSION_TYPE': 'filesystem',
183 'SESSION_FILE_DIR': server.config.FARADAY_SERVER_SESSIONS_DIR,
184
185 'SQLALCHEMY_TRACK_MODIFICATIONS': False,
186 'SQLALCHEMY_RECORD_QUERIES': True,
187 # app.config['SQLALCHEMY_ECHO'] = True
188 'SECURITY_PASSWORD_SCHEMES': [
189 'bcrypt', # This should be the default value
190 # 'des_crypt',
191 'pbkdf2_sha1', # Used by CouchDB passwords
192 # 'pbkdf2_sha256',
193 # 'pbkdf2_sha512',
194 # 'sha256_crypt',
195 # 'sha512_crypt',
196 'plaintext', # TODO: remove it
197 ],
198 'PERMANENT_SESSION_LIFETIME': datetime.timedelta(hours=12),
199 })
200
183201 try:
184202 storage_path = server.config.storage.path
185203 except AttributeError:
213231 db,
214232 user_model=server.models.User,
215233 role_model=None) # We won't use flask security roles feature
216 Security(app, app.user_datastore)
234 Security(app, app.user_datastore, login_form=CustomLoginForm)
217235 # Make API endpoints require a login user by default. Based on
218236 # https://stackoverflow.com/questions/13428708/best-way-to-make-flask-logins-login-required-the-default
219237 app.view_functions['security.login'].is_public = True
238256
239257 app.json_encoder = MiniJSONEncoder
240258 app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
259
260
261 class CustomLoginForm(LoginForm):
262 """A login form that does shows the same error when the username
263 or the password is invalid.
264
265 The builtin form of flask_security generates different messages
266 so it is possible for an attacker to enumerate usernames
267 """
268
269 def validate(self):
270
271 # Use super of LoginForm, not super of CustomLoginForm, since I
272 # want to skip the LoginForm validate logic
273 if not super(LoginForm, self).validate():
274 return False
275 self.user = _datastore.get_user(self.email.data)
276
277 if self.user is None:
278 self.email.errors.append(get_message('USER_DOES_NOT_EXIST')[0])
279 return False
280 if not self.user.password:
281 self.email.errors.append(get_message('USER_DOES_NOT_EXIST')[0])
282 return False
283 if not verify_and_update_password(self.password.data, self.user):
284 self.email.errors.append(get_message('USER_DOES_NOT_EXIST')[0])
285 return False
286 # if requires_confirmation(self.user):
287 # self.email.errors.append(get_message('CONFIRMATION_REQUIRED')[0])
288 # return False
289 if not self.user.is_active:
290 self.email.errors.append(get_message('DISABLED_ACCOUNT')[0])
291 return False
292 return True
1717 import sqlalchemy
1818 from sqlalchemy import create_engine
1919
20 from config.configuration import getInstanceConfiguration
21 from faraday import FARADAY_USER_CONFIG_XML, FARADAY_BASE_CONFIG_XML, \
20 from config.configuration import Configuration
21 from faraday import (
22 FARADAY_USER_CONFIG_XML,
23 FARADAY_BASE_CONFIG_XML,
2224 FARADAY_BASE
25 )
2326
2427 try:
2528 # py2.7
122125 if not already_created:
123126 if not os.path.isfile(FARADAY_USER_CONFIG_XML):
124127 shutil.copy(FARADAY_BASE_CONFIG_XML, FARADAY_USER_CONFIG_XML)
125
128 self._save_user_xml(random_password)
126129 print("Admin user created with \n\n{red}username: {white}faraday \n"
127130 "{red}password:{white} {"
128131 "random_password} \n".format(random_password=random_password,
129132 white=Fore.WHITE, red=Fore.RED))
130133 print("{yellow}WARNING{white}: If you are going to execute couchdb importer you must use the couchdb password for faraday user.".format(white=Fore.WHITE, yellow=Fore.YELLOW))
131134
135 def _save_user_xml(self, random_password):
136 user_xml = os.path.expanduser("~/.faraday/config/user.xml")
137 if not os.path.exists(user_xml):
138 shutil.copy(FARADAY_BASE_CONFIG_XML, user_xml)
139 conf = Configuration(user_xml)
140 conf.setAPIUrl('http://localhost:5985')
141 conf.setAPIUsername('faraday')
142 conf.setAPIPassword(random_password)
143 conf.saveConfig()
132144
133145 def _configure_existing_postgres_user(self):
134146 username = raw_input('Please enter the postgresql username: ')
162174 """
163175 print('This script will {blue} create a new postgres user {white} and {blue} save faraday-server settings {white}(server.ini). '.format(blue=Fore.BLUE, white=Fore.WHITE))
164176 username = 'faraday_postgresql'
165 postgres_command = ['sudo', '-u', 'postgres']
177 postgres_command = ['sudo', '-u', 'postgres', 'psql']
166178 if sys.platform == 'darwin':
167 postgres_command = []
179 print('{blue}MAC OS detected{white}'.format(blue=Fore.BLUE, white=Fore.WHITE))
180 postgres_command = ['psql', 'postgres']
168181 password = self.generate_random_pw(25)
169 command = postgres_command + ['psql', '-c', 'CREATE ROLE {0} WITH LOGIN PASSWORD \'{1}\';'.format(username, password)]
182 command = postgres_command + [ '-c', 'CREATE ROLE {0} WITH LOGIN PASSWORD \'{1}\';'.format(username, password)]
170183 p = Popen(command, stderr=psql_log_file, stdout=psql_log_file)
171184 p.wait()
172185 psql_log_file.seek(0)
177190 print("{yellow}WARNING{white}: Role {username} already exists, skipping creation ".format(yellow=Fore.YELLOW, white=Fore.WHITE, username=username))
178191
179192 try:
193 if not getattr(server.config, 'database', None):
194 print('Manual configuration? \n faraday_postgresql was found in PostgreSQL, but no connection string was found in server.ini. ')
195 print('Please configure [database] section with correct postgresql string. Ex. postgresql+psycopg2://faraday_postgresql:PASSWORD@localhost/faraday')
196 sys.exit(1)
180197 password = server.config.database.connection_string.split(':')[2].split('@')[0]
181198 connection = psycopg2.connect(dbname='postgres',
182199 user=username,
0 #!/usr/bin/env python2.7
01 '''
12 Faraday Penetration Test IDE
23 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
89 import os
910 sys.path.append(os.getcwd())
1011
12 import click
1113 from server.models import db
1214 from server.web import app
15
1316
1417 def reset_db_all():
1518 # It might be required to do a cascade delete to correctly the
3538 reset_db_all()
3639
3740
41 @click.command()
42 @click.option('--confirm/--no-confirme', prompt='Confirm database reset?')
43 def main(confirm):
44 if confirm:
45 reset_db()
46
47
3848 if __name__ == '__main__':
39 option = False
40 while True:
41 print "You are going to delete all info from the DB, this is not undoable, are you sure to follow? [Y/N]",
42 option = raw_input()
43
44 if option.upper() in ['Y', 'N', 'YES', 'NO']:
45 break
46 else:
47 print(str(option) + " option is invalid.")
48
49 if option.upper() in ['Y', 'YES']:
50 reset_db()
49 main()
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 '''
6 import os
7 import sys
8 import socket
9 import argparse
010 import requests
111 import sqlalchemy
2 import socket
3 import os
412 import server.config
513 from colorama import init
14 from server.web import app
15 from server.models import db
16 from utils import dependencies
17 from requests.exceptions import InvalidURL, ConnectionError
618 from colorama import Fore, Back, Style
719 from server.utils.daemonize import is_server_running
8 from server.models import db
9 from server.web import app
1020 from config.configuration import getInstanceConfiguration
11 from utils import dependencies
21 from config import globals as CONSTANTS
1222
1323
1424 CONF = getInstanceConfiguration()
1525
16
1726 init()
1827
1928
2029 def check_server_running():
21
2230 pid = is_server_running()
2331 return pid
2432
4048 result = str(db.engine.execute("SELECT version()"))
4149 return result
4250 except sqlalchemy.exc.OperationalError:
51 return False
52 except sqlalchemy.exc.ArgumentError:
4353 return None
44
54
55 def check_locks_postgresql():
56 with app.app_context():
57 psql_status = check_postgres()
58 if psql_status:
59 result = db.engine.execute("""SELECT blocked_locks.pid AS blocked_pid,
60 blocked_activity.usename AS blocked_user,
61 blocking_locks.pid AS blocking_pid,
62 blocking_activity.usename AS blocking_user,
63 blocked_activity.query AS blocked_statement,
64 blocking_activity.query AS current_statement_in_blocking_process
65 FROM pg_catalog.pg_locks blocked_locks
66 JOIN pg_catalog.pg_stat_activity blocked_activity ON blocked_activity.pid = blocked_locks.pid
67 JOIN pg_catalog.pg_locks blocking_locks
68 ON blocking_locks.locktype = blocked_locks.locktype
69 AND blocking_locks.DATABASE IS NOT DISTINCT FROM blocked_locks.DATABASE
70 AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation
71 AND blocking_locks.page IS NOT DISTINCT FROM blocked_locks.page
72 AND blocking_locks.tuple IS NOT DISTINCT FROM blocked_locks.tuple
73 AND blocking_locks.virtualxid IS NOT DISTINCT FROM blocked_locks.virtualxid
74 AND blocking_locks.transactionid IS NOT DISTINCT FROM blocked_locks.transactionid
75 AND blocking_locks.classid IS NOT DISTINCT FROM blocked_locks.classid
76 AND blocking_locks.objid IS NOT DISTINCT FROM blocked_locks.objid
77 AND blocking_locks.objsubid IS NOT DISTINCT FROM blocked_locks.objsubid
78 AND blocking_locks.pid != blocked_locks.pid
79 JOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid
80 WHERE NOT blocked_locks.GRANTED;""")
81 fetch = result.fetchall()
82 if fetch:
83 return True
84 else:
85 return False
86
87 else:
88 return None
89
4590
4691 def check_client():
4792
4893 port_rest = CONF.getApiRestfulConInfoPort()
4994
95 if port_rest is None:
96 port_rest = "9977"
5097 try:
5198 response_rest = requests.get('http://{}:{}/status/check'.format(server.config.faraday_server.bind_address,port_rest))
5299 return True
53 except requests.exceptions.ConnectionError:
100 except ConnectionError:
54101 return False
55 except requests.exceptions.InvalidURL:
102 except InvalidURL:
56103 return False
57104
58105
89136 return None, None
90137
91138
92
93
94139 def check_credentials():
95140
96141 api_username = CONF.getAPIUsername()
97142 api_password = CONF.getAPIPassword()
143
144 address = server.config.faraday_server.bind_address
145 port = int(server.config.faraday_server.port)
98146
99147 values = {'email': api_username , 'password': api_password}
100148
101149 try:
102 r = requests.post('http://localhost:5985/_api/login', json=values)
150 r = requests.post('http://{ADDRESS}:{PORT}/_api/login'.format(ADDRESS=address,PORT=port), json=values)
103151
104152 if r.status_code == 200 and 'user' in r.json()['response']:
105 return 200
106
153 return 200
107154 elif r.status_code == 400:
108155 return 400
109
110156 elif r.status_code == 500:
111157 return 500
112 except requests.exceptions.ConnectionError:
158
159 except ConnectionError:
113160 return None
114161
115162
116163 def check_storage_permission():
117
118 home = os.path.expanduser("~")
119 path = home+'/.faraday/storage/test'
120
164
165 path = os.path.join(CONSTANTS.CONST_FARADAY_HOME_PATH,'storage/test')
166
121167 try:
122168 os.mkdir(path)
123169 os.rmdir(path)
126172 return None
127173
128174
129 def full_status_check():
130
131
132 #Prints the status of PostreSQL using check_postgres()
133 print('\n{white}Checking if postgreSQL is running...'.format(white=Fore.WHITE))
175 def print_postgresql_status():
176 """Prints the status of PostgreSQL using check_postgres()"""
177 exit_code = 0
134178 result = check_postgres()
135179 if result:
136180 print('[{green}+{white}] PostgreSQL is running'.\
137181 format(green=Fore.GREEN, white=Fore.WHITE))
138
139 else:
140 print('[{red}-{white}] Could not connect to postgresql, please check if database is running'\
182 return exit_code
183 elif result == False:
184 print('[{red}-{white}] Could not connect to PostgreSQL, please check if database is running'\
141185 .format(red=Fore.RED, white=Fore.WHITE))
142 return
143
144 print('\n{white}Checking if Faraday is running...'.format(white=Fore.WHITE))
186 exit_code = 1
187 return exit_code
188 elif result == None:
189 print('[{red}-{white}] Database not initialized. Execute: python manage.py initdb'\
190 .format(red=Fore.RED, white=Fore.WHITE))
191 exit_code = 1
192 return exit_code
193
194 def print_postgresql_locks_status():
195 """Prints the status of locks in Postgresql using check_locks_postgresql()"""
196 lock_status = check_locks_postgresql()
197 if lock_status:
198 print('[{yellow}-{white}] Warning: PostgreSQL lock detected.' \
199 .format(yellow=Fore.YELLOW, white=Fore.WHITE))
200 elif lock_status == False:
201 print('[{green}+{white}] PostgreSQL lock not detected. '.\
202 format(green=Fore.GREEN, white=Fore.WHITE))
203 elif lock_status == None:
204 pass
205
206
207 def print_faraday_status():
208 """Prints Status of farday using check_server_running() and check_client"""
209
210 #Prints Status of the server using check_server_running()
211 pid = check_server_running()
212 if pid is not None:
213 print('[{green}+{white}] Faraday Server is running. PID:{PID} \
214 '.format(green=Fore.GREEN, PID=pid, white=Fore.WHITE))
215 else:
216 print('[{red}-{white}] Faraday Server is not running {white} \
217 '.format(red=Fore.RED, white=Fore.WHITE))
218
219 #Prints Status of the client using check_client()
145220 if check_client():
146221 print('[{green}+{white}] Faraday GTK is running'.\
147222 format(green=Fore.GREEN, white=Fore.WHITE))
149224 print('[{yellow}-{white}] Faraday GTK is not running'\
150225 .format(yellow=Fore.YELLOW, white=Fore.WHITE))
151226
152 #Prints Status of the server using check_server_running()
153 pid = check_server_running()
154 if pid is not None:
155 print('[{green}+{white}] Faraday Server is Running. PID:{PID} \
156 '.format(green=Fore.GREEN, PID=pid, white=Fore.WHITE))
157 else:
158 print('[{red}-{white}] Faraday Server is not running {white} \
159 '.format(red=Fore.RED, white=Fore.WHITE))
160
161
162 print('\n{white}Checking Faraday dependencies...'.format(white=Fore.WHITE))
227
228 def print_depencencies_status():
229 """Prints Status of the dependencies using check_server_dependencies() and check_client_dependencies()"""
163230
164231 status, server_dep = check_server_dependencies()
165
166232 if status == True:
167 print('[{red}-{white}] Some server dependencies are old. Update them with \"pip install -r requirements_server.txt -U\": (' + ','.join(server_dep) + ')') \
233 print('[{red}-{white}] Some server dependencies are old: [' + ', '.join(server_dep) + ']. Update them with \"pip install -r requirements_server.txt -U\"') \
168234 .format(red=Fore.RED, white=Fore.WHITE)
169235
170236 elif status == 0:
171 print('[{red}-{white}] Client dependencies not met. Install them with \"pip install -r requirements_server.txt -U\": (' + ','.join(server_dep) + ')')\
237 print('[{red}-{white}] Client dependencies not met: [' + ', '.join(server_dep) + '] Install them with \"pip install -r requirements_server.txt -U\"')\
172238 .format(red=Fore.RED, white=Fore.WHITE)
173239
174240 else:
177243
178244 status, client_dep = check_client_dependencies()
179245 if status == True:
180 print('[{red}-{white}] Some client dependencies are old. Update them with \"pip install -r requirements.txt -U\": (' + ','.join(client_dep) + ')') \
246 print('[{red}-{white}] Some client dependencies are old: [' + ', '.join(client_dep) + ']. Update them with \"pip install -r requirements.txt -U\"') \
181247 .format(red=Fore.RED, white=Fore.WHITE)
182248
183249 elif status == 0:
184 print('[{red}-{white}] Client dependencies not met. Install them with \"pip install -r requirements.txt -U\": (' + ','.join(client_dep) + ')')\
250 print('[{red}-{white}] Client dependencies not met: [' + ', '.join(client_dep) + ']. Install them with \"pip install -r requirements.txt -U\"')\
185251 .format(red=Fore.RED, white=Fore.WHITE)
186252
187253 else:
189255 .format(green=Fore.GREEN, white=Fore.WHITE))
190256
191257
192 print('\n{white}Checking Faraday config...{white}'.format(white=Fore.WHITE))
258 def print_config_status():
259 """Prints Status of the configuration using check_credentials(), check_storage_permission() and check_open_ports()"""
260
261 pid = check_server_running()
262 result = check_postgres()
193263 if pid and result:
194264 status_code = check_credentials()
195265 if status_code == 200:
198268 print('[{red}-{white}] Error. Credentials does not match' \
199269 .format(red=Fore.RED, white=Fore.WHITE))
200270 else:
201 print('[{red}-{white}] Either Faraday Server not running or database not working'.format(red=Fore.RED, white=Fore.WHITE))
271 print('[{red}-{white}] Credentials can not be checked. Either Faraday Server not running or database not working'.format(red=Fore.RED, white=Fore.WHITE))
202272
203273 if check_storage_permission():
204 print('[{green}+{white}] ~/.faraday/storage -> Permission accepted' \
274 print('[{green}+{white}] /.faraday/storage -> Permission accepted' \
205275 .format(green=Fore.GREEN, white=Fore.WHITE))
206276 else:
207 print('[{red}-{white}] ~/.faraday/storage -> Permission denied'\
277 print('[{red}-{white}] /.faraday/storage -> Permission denied'\
208278 .format(red=Fore.RED, white=Fore.WHITE))
209279
210280 if check_open_ports():
211281 print "[{green}+{white}] Port {PORT} in {ad} is open"\
212282 .format(PORT=server.config.faraday_server.port, green=Fore.GREEN,white=Fore.WHITE,ad=server.config.faraday_server.bind_address)
213283 else:
214 print "[{red}-{white}] in {ad} is not open"\
284 print "[{red}-{white}] Port {PORT} in {ad} is not open"\
215285 .format(PORT=server.config.faraday_server.port,red=Fore.RED,white=Fore.WHITE,ad =server.config.faraday_server.bind_address)
286
287
288 def full_status_check():
289 print('\n{white}Checking if postgreSQL is running...'.format(white=Fore.WHITE))
290 print_postgresql_status()
291 print_postgresql_locks_status()
292
293 print('\n{white}Checking if Faraday is running...'.format(white=Fore.WHITE))
294 print_faraday_status()
295
296 print('\n{white}Checking Faraday dependencies...'.format(white=Fore.WHITE))
297 print_depencencies_status()
298
299 print('\n{white}Checking Faraday config...{white}'.format(white=Fore.WHITE))
300 print_config_status()
2424 # Temporary hack, remove me
2525 os.mkdir(FARADAY_SERVER_SESSIONS_DIR)
2626 FARADAY_SERVER_PID_FILE = os.path.join(
27 CONSTANTS.CONST_FARADAY_HOME_PATH, 'faraday-server.pid')
27 CONSTANTS.CONST_FARADAY_HOME_PATH, 'faraday-server-port-{0}.pid')
2828 REQUIREMENTS_FILE = os.path.join(FARADAY_BASE, 'requirements_server.txt')
2929 DEFAULT_CONFIG_FILE = os.path.join(FARADAY_BASE, 'server/default.ini')
3030 VERSION_FILE = os.path.join(FARADAY_BASE, CONSTANTS.CONST_VERSION_FILE)
100100
101101
102102 def gen_web_config():
103 # Warning: This is publicly accesible via the API, it doesn't even need an
104 # authenticated user. Don't add sensitive information here.
103105 doc = {
104106 'ver': __get_version(),
105107 'lic_db': CONSTANTS.CONST_LICENSES_DB,
1111 import json
1212 import logging
1313 import datetime
14 import threading
1514 import multiprocessing
1615
1716
2726 from slugify import slugify
2827 from sqlalchemy import Text, String
2928 from binascii import unhexlify
29 try:
30 from urllib import quote
31 except ImportError:
32 from urllib.parse import quote
3033
3134 from IPy import IP
3235 from passlib.utils.binary import ab64_encode
563566 port = 65535
564567 service, created = get_or_create(session,
565568 Service,
566 name=document.get('name'),
569 protocol=document.get('protocol'),
567570 port=port,
568571 host=host)
569572 service.description = document.get('description')
570573 service.owned = document.get('owned', False)
571574 service.banner = document.get('banner')
572 service.protocol = document.get('protocol')
575 service.name = document.get('name')
573576 if not document.get('status'):
574577 logger.warning('Service {0} with empty status. Using \'open\' as status'.format(document['_id']))
575578 document['status'] = 'open'
598601 yield service
599602
600603
601 user_lock = threading.Lock()
602604 def get_or_create_user(session, username):
603 with user_lock:
604 rng = SystemRandom()
605 password = "".join(
606 [rng.choice(string.ascii_letters + string.digits) for _ in
607 xrange(12)])
608 creator, created = get_or_create(session, User, username=username)
609 if created:
610 creator.active = False
611 creator.password = password
612 session.add(creator) # remove me
613 session.commit() # remove me
614 return creator
605 rng = SystemRandom()
606 password = "".join(
607 [rng.choice(string.ascii_letters + string.digits) for _ in
608 xrange(12)])
609 creator, created = get_or_create(session, User, username=username)
610 if created:
611 creator.active = False
612 creator.password = password
613 session.add(creator) # remove me
614 session.commit() # remove me
615 return creator
615616
616617
617618 class VulnerabilityImporter(object):
654655 name=document.get('name'),
655656 description=document.get('desc').strip().strip('\n'),
656657 service_id=parent.id,
657 method=method,
658 parameter_name=pname,
659 path=path,
660 website=website,
658 method=method or '',
659 parameter_name=pname or '',
660 path=path or '',
661 website=website or '',
661662 workspace=workspace,
662663 )
663664
741742 password=server.config.couchdb.password,
742743 hostname=server.config.couchdb.host,
743744 port=server.config.couchdb.port,
744 path='{0}/{1}/{2}'.format(workspace.name, document.get('_id'), attachment_name)
745 path='{0}/{1}/{2}'.format(
746 workspace.name,
747 document.get('_id'),
748 quote(attachment_name))
745749 )
746 response = requests.get(attachment_url)
750 try:
751 response = requests.get(attachment_url)
752 response.raise_for_status()
753 except HTTPError:
754 logger.warn(
755 'Unable to fetch attachment {} from workspace '
756 '{}'.format(
757 attachment_name, workspace.name
758 )
759 )
760 logger.debug('Attachment URL: {}'.format(attachment_url))
761 continue
747762 response.raw.decode_content = True
748763 attachment_file = NamedTemporaryFile()
749764 attachment_file.write(response.content)
13301345 workspaces_list = couchdb_server_conn.list_workspaces()
13311346
13321347 except RequestError:
1333 logger.error(u"CouchDB is not running at {}. Check faraday-server's"\
1348 print(u"CouchDB is not running at {}. Check faraday-server's"\
13341349 " configuration and make sure CouchDB is running".format(
13351350 server.couchdb.get_couchdb_url()))
13361351 logger.error(u'Please start CouchDB and re-execute the importer with: \n\n --> python manage.py import_from_couchdb <--')
13371352 sys.exit(1)
13381353
13391354 except Unauthorized:
1340 logger.error(u"Unauthorized access to CouchDB. Make sure faraday-server's"\
1355 print(u"Unauthorized access to CouchDB. Make sure faraday-server's"\
13411356 " configuration file has CouchDB admin's credentials set")
13421357 sys.exit(1)
13431358
13561371 users_import.run()
13571372
13581373 logger.info('Importing workspaces. Using {0} threads'.format(multiprocessing.cpu_count() * 2))
1359 workspace_threads = []
1360 with tqdm(total=len(workspaces_list) * 18,
1361 unit='B', unit_scale=True, unit_divisor=1024) as pbar:
1362 for workspace_name in workspaces_list:
1363 logger.debug(u'Setting up workspace {}'.format(workspace_name))
1364
1365 if not server.couchdb.server_has_access_to(workspace_name):
1366 logger.error(u"Unauthorized access to CouchDB. Make sure faraday-server's"\
1367 " configuration file has CouchDB admin's credentials set")
1368 sys.exit(1)
1369 thread = threading.Thread(target=self.import_workspace_into_database, args=(workspace_name, pbar))
1370 thread.daemon = True
1371 thread.start()
1372 workspace_threads.append(thread)
1373 if len(workspace_threads) > multiprocessing.cpu_count() * 2:
1374 for thread in workspace_threads:
1375 thread.join()
1376 pbar.update(1)
1377 workspace_threads.remove(thread)
1378
1379 logger.info('Waiting for treads to finish.')
1380 for thread in workspace_threads:
1381 thread.join()
1382 pbar.update(1)
1383 #self.import_workspace_into_database(workspace_name)
1374 for workspace_name in workspaces_list:
1375 logger.debug(u'Setting up workspace {}'.format(workspace_name))
1376
1377 if not server.couchdb.server_has_access_to(workspace_name):
1378 logger.error(u"Unauthorized access to CouchDB. Make sure faraday-server's"\
1379 " configuration file has CouchDB admin's credentials set")
1380 sys.exit(1)
1381 self.import_workspace_into_database(workspace_name)
13841382
13851383 def get_objs(self, host, obj_type, level, workspace):
13861384 if obj_type == 'Credential':
13941392
13951393 def verify_host_vulns_count_is_correct(self, couchdb_relational_map, couchdb_relational_map_by_type, workspace):
13961394 hosts = session.query(Host).filter_by(workspace=workspace)
1397 for host in hosts:
1395 logger.info('Verifying data migration')
1396 for host in tqdm(hosts, total=hosts.count()):
13981397 parent_couchdb_id = None
13991398 for couchdb_id, relational_ids in couchdb_relational_map_by_type.items():
14001399 for obj_data in relational_ids:
14041403 if parent_couchdb_id:
14051404 break
14061405 if not parent_couchdb_id:
1407 raise Exception('Could not found couchdb id!')
1406 logger.warn('Could not found couchdb id! This is fine if you created hosts after migration')
1407 continue
14081408 vulns = get_children_from_couch(workspace, parent_couchdb_id, 'Vulnerability')
14091409 interfaces = get_children_from_couch(workspace, parent_couchdb_id, 'Interface')
14101410 for interface in interfaces:
14111411 interface = interface['value']
14121412 vulns += get_children_from_couch(workspace, interface.get('_id'), 'Vulnerability')
14131413
1414 assert len(set(map(lambda vuln: vuln['value'].get('name'), vulns))) == len(set(map(lambda vuln: vuln.name, host.vulnerabilities)))
1414 old_host_count = len(set(map(lambda vuln: vuln['value'].get('name'), vulns)))
1415 new_host_count = len(set(map(lambda vuln: vuln.name, host.vulnerabilities)))
1416 if old_host_count != new_host_count:
1417 logger.info("Host count didn't match")
1418 if old_host_count < new_host_count:
1419 logger.warn('More host were found in postgreSQL. This is normal if you used the workspace {0}'.format(workspace.id))
1420 if new_host_count < old_host_count:
1421 logger.error('Some hosts were not imported!!')
14151422
14161423 def verify_import_data(self, couchdb_relational_map, couchdb_relational_map_by_type, workspace):
14171424 self.verify_host_vulns_count_is_correct(couchdb_relational_map, couchdb_relational_map_by_type, workspace)
14491456 def import_level_objects(self, couch_url, faraday_importer, couchdb_relational_map_by_type, couchdb_relational_map, command_tool_map, level, obj_type, workspace):
14501457 obj_importer = faraday_importer.get_importer_from_document(obj_type)()
14511458 objs_dict = self.get_objs(couch_url, obj_type, level, workspace)
1452 for raw_obj in (objs_dict.get('rows', [])):
1459 print('Importing {0} from workspace {1}'.format(obj_type, workspace.name))
1460 for raw_obj in tqdm(objs_dict.get('rows', [])):
14531461 # we use no_autoflush since some queries triggers flush and some relationship are missing in the middle
14541462 with session.no_autoflush:
14551463 raw_obj = raw_obj['value']
14681476 couchdb_relational_map_by_type[couchdb_id].append({'type': obj_type, 'id': new_obj.id})
14691477 couchdb_relational_map[couchdb_id].append(new_obj.id)
14701478
1471 def import_workspace_into_database(self, workspace_name, pbar):
1479 def import_workspace_into_database(self, workspace_name):
14721480 with app.app_context():
14731481
14741482 faraday_importer = FaradayEntityImporter(workspace_name)
15031511 )
15041512 except Exception as ex:
15051513 logger.exception(ex)
1506 raise
1507 pbar.update(1)
1514 continue
15081515 update_command_tools(workspace, command_tool_map,
15091516 couchdb_relational_map_by_type)
15101517 session.commit()
257257 UniqueConstraint(ip, workspace_id, name='uix_host_ip_workspace'),
258258 )
259259
260 vulnerability_info_count = query_expression()
261 vulnerability_med_count = query_expression()
262 vulnerability_high_count = query_expression()
263 vulnerability_critical_count = query_expression()
264 vulnerability_low_count = query_expression()
265 vulnerability_unclassified_count = query_expression()
266 vulnerability_total_count = query_expression()
267
268 @classmethod
269 def query_with_count(cls, only_confirmed, host_ids, workspace_name):
270 query = cls.query.join(Workspace).filter(Workspace.name == workspace_name)
271 if host_ids:
272 query = query.filter(cls.id.in_(host_ids))
273 return query.options(
274 with_expression(
275 cls.vulnerability_info_count,
276 _make_vuln_count_property(
277 type_=None,
278 only_confirmed = only_confirmed,
279 use_column_property = False,
280 extra_query = "vulnerability.severity='informational'",
281 get_hosts_vulns = True
282 )
283 ),
284 with_expression(
285 cls.vulnerability_med_count,
286 _make_vuln_count_property(
287 type_ = None,
288 only_confirmed = only_confirmed,
289 use_column_property = False,
290 extra_query = "vulnerability.severity='medium'",
291 get_hosts_vulns = True
292 )
293 ),
294 with_expression(
295 cls.vulnerability_high_count,
296 _make_vuln_count_property(
297 type_ = None,
298 only_confirmed = only_confirmed,
299 use_column_property = False,
300 extra_query = "vulnerability.severity='high'",
301 get_hosts_vulns = True
302 )
303 ),
304 with_expression(
305 cls.vulnerability_critical_count,
306 _make_vuln_count_property(
307 type_ = None,
308 only_confirmed = only_confirmed,
309 use_column_property = False,
310 extra_query = "vulnerability.severity='critical'",
311 get_hosts_vulns = True
312 )
313 ),
314 with_expression(
315 cls.vulnerability_low_count,
316 _make_vuln_count_property(
317 type_ = None,
318 only_confirmed = only_confirmed,
319 use_column_property = False,
320 extra_query = "vulnerability.severity='low'",
321 get_hosts_vulns = True
322 )
323 ),
324 with_expression(
325 cls.vulnerability_unclassified_count,
326 _make_vuln_count_property(
327 type_ = None,
328 only_confirmed = only_confirmed,
329 use_column_property = False,
330 extra_query = "vulnerability.severity='unclassified'",
331 get_hosts_vulns = True
332 )
333 ),
334 with_expression(
335 cls.vulnerability_total_count,
336 _make_vuln_count_property(
337 type_ = None,
338 only_confirmed = only_confirmed,
339 use_column_property = False,
340 get_hosts_vulns = True
341 )
342 ),
343 )
344
260345 @property
261346 def parent(self):
262347 return
478563 # we need to fetch already created objs.
479564 session.rollback()
480565 for conflict_obj in conflict_objs:
481 if hasattr(conflict_obj, 'name') and conflict_obj.name == value:
566 if not hasattr(conflict_obj, 'name'):
567 # The session can hold elements without a name (altough it shouldn't)
568 continue
569 if conflict_obj.name == value:
482570 continue
483571 persisted_conclict_obj = session.query(conflict_obj.__class__).filter_by(name=conflict_obj.name).first()
484572 if persisted_conclict_obj:
493581 def _build_associationproxy_creator(model_class_name):
494582 def creator(name, vulnerability):
495583 """Get or create a reference/policyviolation with the
496 corresponding name. This must be worspace aware"""
584 corresponding name. This must be workspace aware"""
497585
498586 # Ugly hack to avoid the fact that Reference is defined after
499587 # Vulnerability
516604 def _build_associationproxy_creator_non_workspaced(model_class_name):
517605 def creator(name, vulnerability):
518606 """Get or create a reference/policyviolation with the
519 corresponding name. This must be worspace aware"""
607 corresponding name. This must be workspace aware"""
520608
521609 # Ugly hack to avoid the fact that Reference is defined after
522610 # Vulnerability
11281216
11291217
11301218 def _make_vuln_count_property(type_=None, only_confirmed=False,
1131 use_column_property=True, extra_query=None):
1132 query = (select([func.count(text('vulnerability.id'))]).
1133 select_from(table('vulnerability')).
1134 where(text('vulnerability.workspace_id = workspace.id'))
1219 use_column_property=True, extra_query=None, get_hosts_vulns=False):
1220 from_clause = table('vulnerability')
1221
1222 if get_hosts_vulns:
1223 from_clause = from_clause.join(
1224 Service, Vulnerability.service_id == Service.id,
1225 isouter=True
1226 )
1227
1228 query = (select([func.count(text('distinct(vulnerability.id)'))]).
1229 select_from(from_clause)
11351230 )
1231 if get_hosts_vulns:
1232 query = query.where(text('(vulnerability.host_id = host.id OR host.id = service.host_id)'))
1233 else:
1234 query = query.where(text('vulnerability.workspace_id = workspace.id'))
1235
11361236 if type_:
11371237 # Don't do queries using this style!
11381238 # This can cause SQL injection vulnerabilities
66 # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
77
88 import os
9 import re
10 import random
911 import sys
1012 import errno
1113 import atexit
136138 WORKDIR = server.config.FARADAY_BASE
137139 createDaemon()
138140
139 def stop_server():
141 def stop_server(port):
140142 """Stops Faraday Server if it isn't running"""
141143 logger = get_logger(__name__)
142 pid = is_server_running()
144 pid = is_server_running(port)
143145 if pid is None:
144146 logger.error('Faraday Server is not running')
145147 return False
146148
147149 try:
148 logger.info('Sending SIGTERM to pid {0}'.format(pid))
150 logger.info('Sending SIGTERM to pid {0}, in port {1}'.format(pid, port))
149151 os.kill(pid, signal.SIGTERM)
152 logger.info("Faraday Server stopped successfully")
150153 except OSError, err:
151154 if err.errno == errno.EPERM:
152155 logger.error("Couldn't stop Faraday Server. User doesn't"\
157160
158161 return True
159162
160 def is_server_running():
163 def is_server_running(port):
161164 """Returns server PID if it is running. Otherwise returns None"""
162165 logger = get_logger(__name__)
163166
164 pid = get_server_pid()
167 pid = get_server_pid(port)
165168 if pid is None:
166169 return None
167170
169172 os.kill(pid, 0)
170173 except OSError, err:
171174 if err.errno == errno.ESRCH:
172 remove_pid_file()
175 remove_pid_file(port)
173176 return None
174177 elif err.errno == errno.EPERM:
175178 logger.warning("Server is running BUT the current user"\
180183 else:
181184 return pid
182185
183 def get_server_pid():
186 def get_server_pid(port):
184187 logger = get_logger(__name__)
185188
186 if not os.path.isfile(server.config.FARADAY_SERVER_PID_FILE):
189 if not os.path.isfile(server.config.FARADAY_SERVER_PID_FILE.format(port)):
187190 return None
188191
189 with open(server.config.FARADAY_SERVER_PID_FILE, 'r') as pid_file:
192 with open(server.config.FARADAY_SERVER_PID_FILE.format(port), 'r') as pid_file:
190193 # If PID file is badly written, delete it and
191194 # assume server is not running
192195 try:
195198 logger.warning('PID file was found but is corrupted. '\
196199 'Assuming server is not running. Please check manually'\
197200 'if Faraday Server is effectively running')
198 remove_pid_file()
201 remove_pid_file(port)
199202 return None
200
203
201204 return pid
202205
203 def create_pid_file():
204 with open(server.config.FARADAY_SERVER_PID_FILE, 'w') as pid_file:
206 def create_pid_file(port):
207 with open(server.config.FARADAY_SERVER_PID_FILE.format(port), 'w') as pid_file:
205208 pid_file.write('{}'.format(os.getpid()))
206209 atexit.register(remove_pid_file)
207210
208 def remove_pid_file():
209 os.remove(server.config.FARADAY_SERVER_PID_FILE)
210
211 def remove_pid_file(port):
212 os.remove(server.config.FARADAY_SERVER_PID_FILE.format(port))
213
214 def get_ports_running():
215 ports = []
216 re_string = re.escape(server.config.FARADAY_SERVER_PID_FILE)
217 re_string = re_string.replace("\{0\}","[0-9]+")
218 home_dir = os.listdir(server.config.CONSTANTS.CONST_FARADAY_HOME_PATH)
219
220 for path in home_dir:
221 path = server.config.CONSTANTS.CONST_FARADAY_HOME_PATH + "/" + path
222 if re.match(re_string,path):
223 port = path.split("-")[-1].split(".")[0]
224 ports.append(int(port))
225
226 return ports
4545
4646
4747 def clean_char(char):
48 #Get rid of the ctrl characters first.
49 #http://stackoverflow.com/questions/1833873/python-regex-escape-characters
50 char = re.sub('\x1b[^m]*m', '', char)
51 #Clean up invalid xml
52 char = remove_invalid_chars(char)
53 replacements = [
54 (u'\u201c', '\"'),
55 (u'\u201d', '\"'),
56 (u"\u001B", ' '), #http://www.fileformat.info/info/unicode/char/1b/index.htm
57 (u"\u0019", ' '), #http://www.fileformat.info/info/unicode/char/19/index.htm
58 (u"\u0016", ' '), #http://www.fileformat.info/info/unicode/char/16/index.htm
59 (u"\u001C", ' '), #http://www.fileformat.info/info/unicode/char/1c/index.htm
60 (u"\u0003", ' '), #http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=0x
61 (u"\u000C", ' ')
62 ]
63 for rep, new_char in replacements:
64 if char == rep:
65 #print ord(char), char.encode('ascii', 'ignore')
66 return new_char
67 return char
48 try:
49 #Get rid of the ctrl characters first.
50 #http://stackoverflow.com/questions/1833873/python-regex-escape-characters
51 char = re.sub('\x1b[^m]*m', '', char)
52 #Clean up invalid xml
53 char = remove_invalid_chars(char)
54 replacements = [
55 (u'\u201c', '\"'),
56 (u'\u201d', '\"'),
57 (u"\u001B", ' '), #http://www.fileformat.info/info/unicode/char/1b/index.htm
58 (u"\u0019", ' '), #http://www.fileformat.info/info/unicode/char/19/index.htm
59 (u"\u0016", ' '), #http://www.fileformat.info/info/unicode/char/16/index.htm
60 (u"\u001C", ' '), #http://www.fileformat.info/info/unicode/char/1c/index.htm
61 (u"\u0003", ' '), #http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=0x
62 (u"\u000C", ' ')
63 ]
64 for rep, new_char in replacements:
65 if char == rep:
66 #print ord(char), char.encode('ascii', 'ignore')
67 return new_char
68 #get here if pass all controls, so try to encode or throw UnicodeEncodeError
69 char.encode()
70
71 return char
72 except UnicodeEncodeError:
73 # Ugly hack triggered when importing some strange objects
74 return ''
6875
6976
7077 def remove_invalid_chars(c):
5252 ret = super(FileWithoutDirectoryListing, self).render(request)
5353 if self.type == 'text/html':
5454 request.responseHeaders.addRawHeader('Content-Security-Policy',
55 'frame-ancestors \'none\'')
56 request.responseHeaders.addRawHeader('X-Frame-Options', 'DENY')
55 'frame-ancestors \'self\'')
56 request.responseHeaders.addRawHeader('X-Frame-Options', 'SAMEORIGIN')
5757 return ret
5858
5959
216216 .jumbotron {
217217 background-color: #f4f3f4;
218218 }
219
220 .btn {
221 border-radius: 0px;
222 }
195195 .untercio article{
196196 height: 20%;
197197 }
198 .seccion article {
199 min-height: 85px;
200 font-size: 11px;
201 text-align: left;
202 }
203 .seccion article header {
204 background: #FFFFFF;
205 min-height: 40px;
206 text-align: left;
207 }
198 .seccion article {
199 min-height: 85px;
200 font-size: 11px;
201 text-align: left;
202 }
203 .seccion article header {
204 background: #FFFFFF;
205 min-height: 40px;
206 text-align: left;
207 }
208208 .seccion article header h2 {
209209 color: #101010;
210210 font-size: 14px;
13071307 }
13081308 .label-success-impact {
13091309 background-color: #5cb85c
1310 }
1310 }
110110
111111 .workspace-switcher-title .title{
112112 width: 90%;
113 overflow: hidden;
113114 }
114115
115116 .workspace-switcher-title .caret-container{
0 <?xml version="1.0" encoding="utf-8"?>
1 <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
2 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3 viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;" xml:space="preserve">
4 <style type="text/css">
5 .st0{fill:#AFAFAF;}
6 .st1{fill:#FFFFFF;}
7 </style>
8 <circle id="XMLID_1_" class="st0" cx="7.5" cy="7.5" r="7.5"/>
9 <polygon id="XMLID_2_" class="st1" points="3.9,8.2 6.5,10.8 11.5,5.8 10.3,4.6 6.5,8.4 5,6.9 "/>
10 </svg>
0 <?xml version="1.0" encoding="utf-8"?>
1 <!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
2 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3 viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;" xml:space="preserve">
4 <style type="text/css">
5 .st0{fill:#488BE6;}
6 .st1{fill:#FFFFFF;}
7 </style>
8 <circle id="XMLID_1_" class="st0" cx="7.5" cy="7.5" r="7.5"/>
9 <polygon id="XMLID_2_" class="st1" points="3.9,8.2 6.5,10.8 11.5,5.8 10.3,4.6 6.5,8.4 5,6.9 "/>
10 </svg>
0 <?xml version="1.0" encoding="utf-8"?>
1 <!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
2 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3 viewBox="0 0 33 33" style="enable-background:new 0 0 33 33;" xml:space="preserve">
4 <g transform="translate(0,-952.36218)">
5 <g>
6 <path d="M16.7,956.6c-2.4,0-4.7,0.9-6.5,2.7c-1.4,1.4-2.2,3.1-2.5,5c-3.5,0.6-6.3,3.6-6.3,7.3c0,4.1,3.3,7.4,7.4,7.4h3.7
7 c0.4,0,0.7-0.3,0.7-0.7s-0.3-0.7-0.7-0.7l0,0H8.9c-3.3,0-6.1-2.8-6.1-6.1c0-3.1,2.4-5.8,5.5-6.1c0.3,0,0.6-0.3,0.6-0.6
8 c0.2-1.7,1-3.3,2.2-4.6c1.5-1.5,3.5-2.3,5.5-2.3s4,0.8,5.5,2.3c1.7,1.7,2.5,4.2,2.2,6.5c0,0.4,0.2,0.7,0.6,0.8H25h0.4
9 c2.9,0,5,2.3,5,5c0,2.9-2.3,5-5,5h-4.8c-0.4,0-0.7,0.3-0.7,0.7s0.3,0.7,0.7,0.7l0,0h4.8c3.5,0,6.5-2.9,6.5-6.5
10 c0-3.4-2.8-6.3-6.2-6.4c0.1-2.5-0.8-5-2.7-6.9C21.4,957.5,19.1,956.6,16.7,956.6z M16.7,966.9c-0.2,0-0.4,0.1-0.5,0.2l-3.7,3.4
11 c-0.3,0.3-0.3,0.7-0.1,1c0.3,0.3,0.7,0.3,1,0l2.6-2.4v10.7c0,0.4,0.3,0.7,0.7,0.7s0.7-0.3,0.7-0.7v-10.7l2.6,2.4
12 c0.3,0.3,0.7,0.2,1,0c0.3-0.3,0.2-0.8-0.1-1l-3.7-3.4C17,966.9,16.9,966.9,16.7,966.9z"/>
13 <path d="M16.6,980.9c-0.6,0-1.1-0.5-1.1-1.1v-9.6l-1.8,1.6c-0.5,0.5-1.1,0.5-1.6,0c-0.4-0.6-0.3-1.2,0.1-1.6l3.7-3.4
14 c0.2-0.2,0.5-0.3,0.8-0.3c0.5,0,0.7,0.2,0.7,0.4l3.6,3.3c0.2,0.1,0.4,0.4,0.4,0.8c0,0.3-0.1,0.6-0.3,0.9c-0.6,0.4-1.2,0.4-1.6,0
15 l-1.8-1.6v9.6C17.8,980.4,17.3,980.9,16.6,980.9z M16.4,968v11.8c0,0.2,0.4,0.2,0.4,0V968l3.4,3.1c0.1,0.1,0.3,0,0.4,0
16 c0,0,0,0,0-0.1c0-0.1,0-0.1-0.1-0.1l-3.8-3.5c0,0,0,0-0.1,0l-3.7,3.4c-0.1,0.1-0.1,0.3,0,0.3c0,0,0.1,0,0.2-0.1L16.4,968z
17 M25.4,979.5h-4.8c-0.6,0-1.1-0.5-1.1-1.1s0.5-1.1,1.1-1.1h4.8c2.6,0,4.6-2,4.6-4.6c0-2.6-2-4.6-4.6-4.6l-0.6,0
18 c-0.6-0.1-0.9-0.6-0.9-1.2c0.3-2.3-0.5-4.6-2.1-6.1c-1.4-1.4-3.2-2.1-5.2-2.1c-2,0-3.8,0.8-5.2,2.1c-1.1,1.1-1.9,2.7-2.1,4.3
19 c0,0.5-0.5,1-1,1c-2.8,0.3-5,2.7-5,5.6c0,3,2.6,5.6,5.6,5.6h3.7c0.6,0,1.1,0.5,1.1,1.1s-0.5,1.1-1.1,1.1H8.9
20 c-4.4,0-7.9-3.5-7.9-7.9c0-3.7,2.7-7,6.3-7.7c0.4-1.9,1.2-3.6,2.6-4.9c1.8-1.8,4.2-2.8,6.8-2.8c2.7,0,5,1,6.6,2.8
21 c1.8,1.8,2.8,4.2,2.8,6.7c3.5,0.3,6.2,3.3,6.2,6.8C32.3,976.4,29.2,979.5,25.4,979.5z M20.6,978.1c-0.1,0-0.2,0.1-0.2,0.2
22 s0.1,0.2,0.2,0.2h4.8c3.3,0,6-2.7,6-6c0-3.2-2.6-5.8-5.7-5.9l-0.5,0l0-0.5c0.1-2.5-0.8-4.8-2.5-6.5c-1.5-1.6-3.6-2.5-5.9-2.5
23 c-2.4,0-4.5,0.9-6.1,2.5c-1.3,1.3-2.1,2.8-2.3,4.7l-0.1,0.3l-0.3,0.1c-3.4,0.5-5.9,3.5-5.9,6.9c0,3.8,3.1,7,7,7h3.7
24 c0.1,0,0.2-0.1,0.2-0.2s-0.1-0.2-0.2-0.2H8.9c-3.6,0-6.6-2.9-6.6-6.6c0-3.4,2.6-6.3,6-6.6c0.1,0,0.1-0.1,0.1-0.1
25 c0.2-1.9,1-3.6,2.3-4.9c1.6-1.6,3.6-2.4,5.9-2.4c2.2,0,4.3,0.9,5.9,2.4c1.8,1.8,2.6,4.3,2.3,6.9c0,0.1,0.1,0.2,0.2,0.2h0.4
26 c3.1,0,5.5,2.4,5.5,5.5c0,3.1-2.4,5.5-5.5,5.5H20.6z"/>
27 </g>
28 </g>
29 </svg>
8282 <script type="text/javascript" src="script/moment.js"></script>
8383 <script type="text/javascript" src="script/angular-moment.js"></script>
8484 <script type="text/javascript" src="script/papaparse.min.js"></script>
85 <script type="text/javascript" src="script/ng-rollbar.min.js"></script>
8685 </head>
8786
8887 <body ng-controller="loginBackgroundCtrl" ng-class="{'login': isLogin}">
+0
-1
server/www/script/ng-rollbar.min.js less more
0 (function(angular){angular.module("tandibar/ng-rollbar",[]);angular.module("tandibar/ng-rollbar").config(["$provide",function($provide){$provide.decorator("$exceptionHandler",["$delegate","$injector","$window",function($delegate,$injector,$window){return function(exception,cause){if($window.Rollbar){$window.Rollbar.error(exception,{cause:cause},function(err,data){var $rootScope=$injector.get("$rootScope");$rootScope.$emit("rollbar:exception",{exception:exception,err:err,data:data.result})})}$delegate(exception,cause)}}])}]);angular.module("tandibar/ng-rollbar").provider("Rollbar",function RollbarProvider(){var rollbarProvider=this;var rollbarActivated=true;this.init=function(config){var _rollbarConfig=config;if(rollbarActivated){!function(r){function o(n){if(e[n])return e[n].exports;var t=e[n]={exports:{},id:n,loaded:!1};return r[n].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}var e={};return o.m=r,o.c=e,o.p="",o(0)}([function(r,o,e){"use strict";var n=e(1),t=e(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.3.1/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,o,e){"use strict";function n(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}function t(r,o){this.options=r,this._rollbarOldOnError=null;var e=s++;this.shimId=function(){return e},window&&window._rollbarShims&&(window._rollbarShims[e]={handler:o,messages:[]})}function a(r,o){var e=o.globalAlias||"Rollbar";if("object"==typeof r[e])return r[e];r._rollbarShims={},r._rollbarWrappedError=null;var t=new p(o);return n(function(){o.captureUncaught&&(t._rollbarOldOnError=r.onerror,i.captureUncaughtExceptions(r,t,!0),i.wrapGlobals(r,t,!0)),o.captureUnhandledRejections&&i.captureUnhandledRejections(r,t,!0);var n=o.autoInstrument;return o.enabled!==!1&&(void 0===n||n===!0||"object"==typeof n&&n.network)&&r.addEventListener&&(r.addEventListener("load",t.captureLoad.bind(t)),r.addEventListener("DOMContentLoaded",t.captureDomContentLoaded.bind(t))),r[e]=t,t})()}function l(r){return n(function(){var o=this,e=Array.prototype.slice.call(arguments,0),n={shim:o,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)})}var i=e(2),s=0,d=e(3),c=function(r,o){return new t(r,o)},p=d.bind(null,c);t.prototype.loadFull=function(r,o,e,t,a){var l=function(){var o;if(void 0===r._rollbarDidLoad){o=new Error("rollbar.js did not load");for(var e,n,t,l,i=0;e=r._rollbarShims[i++];)for(e=e.messages||[];n=e.shift();)for(t=n.args||[],i=0;i<t.length;++i)if(l=t[i],"function"==typeof l){l(o);break}}"function"==typeof a&&a(o)},i=!1,s=o.createElement("script"),d=o.getElementsByTagName("script")[0],c=d.parentNode;s.crossOrigin="",s.src=t.rollbarJsUrl,e||(s.async=!0),s.onload=s.onreadystatechange=n(function(){if(!(i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){s.onload=s.onreadystatechange=null;try{c.removeChild(s)}catch(r){}i=!0,l()}}),c.insertBefore(s,d)},t.prototype.wrap=function(r,o,e){try{var n;if(n="function"==typeof o?o:function(){return o||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){e&&"function"==typeof e&&e.apply(this,arguments);try{return r.apply(this,arguments)}catch(e){var o=e;throw"string"==typeof o&&(o=new String(o)),o._rollbarContext=n()||{},o._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=o,o}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(o){return r}};for(var u="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<u.length;++f)t.prototype[u[f]]=l(u[f]);r.exports={setupShim:a,Rollbar:p}},function(r,o){"use strict";function e(r,o,e){if(r){var t;"function"==typeof o._rollbarOldOnError?t=o._rollbarOldOnError:r.onerror&&!r.onerror.belongsToShim&&(t=r.onerror,o._rollbarOldOnError=t);var a=function(){var e=Array.prototype.slice.call(arguments,0);n(r,o,t,e)};a.belongsToShim=e,r.onerror=a}}function n(r,o,e,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null),o.handleUncaughtException.apply(o,n),e&&e.apply(r,n)}function t(r,o,e){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var e=r.reason,n=r.promise,t=r.detail;!e&&t&&(e=t.reason,n=t.promise),o&&o.handleUnhandledRejection&&o.handleUnhandledRejection(e,n)};n.belongsToShim=e,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}function a(r,o,e){if(r){var n,t,a="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<a.length;++n)t=a[n],r[t]&&r[t].prototype&&l(o,r[t].prototype,e)}}function l(r,o,e){if(o.hasOwnProperty&&o.hasOwnProperty("addEventListener")){for(var n=o.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(o,e,t){n.call(this,o,r.wrap(e),t)};t._rollbarOldAdd=n,t.belongsToShim=e,o.addEventListener=t;for(var a=o.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,o,e){a.call(this,r,o&&o._rollbar_wrapped||o,e)};l._rollbarOldRemove=a,l.belongsToShim=e,o.removeEventListener=l}}r.exports={captureUncaughtExceptions:e,captureUnhandledRejections:t,wrapGlobals:a}},function(r,o){"use strict";function e(r,o){this.impl=r(o,this),this.options=o,n(e.prototype)}function n(r){for(var o=function(r){return function(){var o=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,o)}},e="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<e.length;n++)r[e[n]]=o(e[n])}e.prototype._swapAndProcessMessages=function(r,o){this.impl=r(this.options);for(var e,n,t;e=o.shift();)n=e.method,t=e.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],e.ts]):this[n].apply(this,t));return this},r.exports=e},function(r,o){"use strict";r.exports=function(r){return function(o){if(!o&&!window._rollbarInitialized){r=r||{};for(var e,n,t=r.globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;e=window._rollbarShims[i++];)n||(n=e.handler),e.handler._swapAndProcessMessages(l,e.messages);window[t]=n,window._rollbarInitialized=!0}}}}])}};this.deinit=function(){rollbarActivated=false};getter.$inject=["$log","$window"];function getter($log,$window){function _bindRollbarMethod(methodName){return function(){$window.Rollbar[methodName].apply($window.Rollbar,arguments)}}var service={Rollbar:logInactiveMessage,configure:logInactiveMessage,critical:logInactiveMessage,error:logInactiveMessage,warning:logInactiveMessage,info:logInactiveMessage,debug:logInactiveMessage,scope:logInactiveMessage,verbose:logInactiveMessage,enable:logInactiveMessage,disable:logInactiveMessage};if(rollbarActivated){service.Rollbar=$window.Rollbar;service.configure=_bindRollbarMethod("configure");service.critical=_bindRollbarMethod("critical");service.error=_bindRollbarMethod("error");service.warning=_bindRollbarMethod("warning");service.info=_bindRollbarMethod("info");service.debug=_bindRollbarMethod("debug");service.scope=_bindRollbarMethod("scope");service.verbose=function(boolean){if(boolean===undefined){boolean=true}$window.Rollbar.configure({verbose:boolean})};service.enable=function(){$window.Rollbar.configure({enabled:true})};service.disable=function(){$window.Rollbar.configure({enabled:false})}}function logInactiveMessage(){$log.warn("Rollbar is deactivated")}return service}this.$get=getter})})(angular);
1111 'filter', 'angular-clipboard', 'ngCookies', 'cfp.hotkeys', 'chart.js',
1212 'ui.grid', 'ui.grid.selection', 'ui.grid.grouping', 'ngSanitize',
1313 'ui.grid.pagination', 'ui.grid.pinning', 'angularMoment', 'ui-notification',
14 'tandibar/ng-rollbar', 'ui.grid.resizeColumns'])
14 'ui.grid.resizeColumns'])
1515 .constant("BASEURL", (function() {
1616 var url = window.location.origin + "/";
1717 return url;
7070 return statuses;
7171 })());
7272
73 faradayApp.config(['$routeProvider', '$uibTooltipProvider', 'RollbarProvider',
74 function($routeProvider, $uibTooltipProvider, RollbarProvider) {
73 faradayApp.config(['$routeProvider', '$uibTooltipProvider',
74 function($routeProvider, $uibTooltipProvider) {
7575 $uibTooltipProvider.options({
7676 appendToBody: true
7777 });
285285 templateUrl: 'scripts/commons/partials/home.html',
286286 controller: 'homeCtrl'
287287 });
288 RollbarProvider.init({
289 accessToken: "70f0c36ae96d4ffc90394565b42c5bf9",
290 captureUncaught: true,
291 payload: {
292 environment: "white-newdesign"
293 }});
294288 }]);
295289
296290 faradayApp.run(['$location', '$rootScope', 'loginSrv', function($location, $rootScope, loginSrv) {
1818
1919 // Ugly, ugly, ugly hack
2020 $scope.vulnsNum = vulnsManager.getVulnsNum($routeParams.wsId);
21 $scope.totalVulns = vulnsManager.getTotalVulns($routeParams.wsId);
2122 setInterval(function(){
2223 $scope.vulnsNum = vulnsManager.getVulnsNum($routeParams.wsId);
24 $scope.totalVulns = vulnsManager.getTotalVulns($routeParams.wsId);
2325 $scope.$apply();
2426 }, 500)
2527
8688 // copy pasted from server/www/scripts/workspaces/controllers/workspaces.js
8789 // it makes scope work properly (i think)
8890 workspace.scope = workspace.scope.map(function(scope){
89 return {key: scope}
91 if(scope.key === undefined)
92 return {key: scope};
93 return scope;
9094 });
9195 if (workspace.scope.length == 0) workspace.scope.push({key: ''});
9296
3030 </span>
3131 </div>
3232 <span class="subtitle">
33 {{vulnsNum}} vulns total
33 {{vulnsNum}}/{{totalVulns}} vulns
3434 </span>
3535 </div>
3636 </button>
342342 return get(url, payload)
343343 }
344344
345 ServerAPI.getVulnsGroupedBy = function(wsName, groupBy) {
345 ServerAPI.getVulnsGroupedBy = function(wsName, groupBy, confirmed) {
346346 var url = createGetUrl(wsName, 'vulns') + 'count/';
347347 var payload = {'group_by': groupBy}
348 if (confirmed) {
349 payload.confirmed = confirmed;
350 }
348351
349352 return get(url, payload)
350353 }
113113 });
114114
115115 // Make the workspace vuln counter work
116 vulnsManager.loadVulnsCounter($scope.workspace);
116 if(typeof $scope.workspace !== 'undefined'){
117 vulnsManager.loadVulnsCounter($scope.workspace);
118 }
117119 };
118120
119121 var removeFromView = function(credential){
265267 });
266268 };
267269
270 $scope.clearSearch = function() {
271 $scope.search = '';
272 }
273
268274 // toggles sort field and order
269275 $scope.toggleSort = function(field) {
270276 $scope.toggleSortField(field);
2828 <form role="form">
2929 <div class="form-group">
3030 <div class="input-group">
31 <span class="input-group-addon glyphicon-btn glyphicon glyphicon-remove" ng-if="search && search != 'confirmed=true'" ng-click="clearSearch()"></span>
31 <span class="input-group-addon glyphicon-btn glyphicon glyphicon-remove" ng-if="search && search != 'confirmed=true'" style="cursor: pointer" ng-click="clearSearch()"></span>
3232 <input type="text" class="form-control" placeholder="Enter keywords" ng-model="search" />
3333 <span class="input-group-addon glyphicon-btn">
3434 <img src="images/icon-toolbar-searchbar-loupe.svg" class="search-icon" />
4444 <table ng-if="credentials.length > 0" class="table-v3 licenses-list table table-responsive">
4545 <thead>
4646 <tr class="ui-grid-header">
47 <th class="ui-grid-cell-contents ui-grid-header-cell hosts-list-checkall"><input type="checkbox" ng-model="selectall" ng-click="checkAll()"/></th>
47 <th class="ui-grid-cell-contents checkbox-select ui-grid-header-cell">
48 <input type="checkbox" ng-model="selectall" ng-click="checkAll()"/>
49 </th>
4850 <th ng-if="!parentObject.parent_type" class="ui-grid-cell-contents ui-grid-header-cell">
4951 <span ng-click="toggleSort('target')">Target</span>
5052 </th>
6567 selection-model-mode="multiple-additive"
6668 selection-model-selected-class="multi-selected"
6769 selection-model-on-change="selectedCredentials()">
68 <td class="ui-grid-cell-contents checkbox-select"><input type="checkbox" name="{{credential._id}}"/></td>
70 <td class="ui-grid-cell-contents checkbox-select">
71 <input type="checkbox" name="{{credential._id}}"/>
72 </td>
6973 <td class="ui-grid-cell-contents" ng-if="!parentObject.parent_type"> {{credential.target}} </td>
7074 <td class="ui-grid-cell-contents">{{credential.name}}</td>
7175 <td class="ui-grid-cell-contents">{{credential.username}}</td>
1111 init = function() {
1212 if($routeParams.wsId != undefined) {
1313 $scope.workspace = $routeParams.wsId;
14 $scope.loadData();
1415
15 dashboardSrv.getVulnerabilitiesGroupedBy($scope.workspace, 'status')
16 .then(function(vulnsByStatus) {
17 $scope.data = {key: [], value: [], colors: [], options: {maintainAspectRatio: false, animateRotate: true}};
18 $scope.loaded = true;
19
20 vulnerabilityColors = {
21 'open': '#e77273',
22 'closed': '#bddd72',
23 're-opened': '#e7d174',
24 'risk-accepted': '#7aabd9'
25 };
26
27 vulnsByStatus.forEach(function(vuln, index) {
28 $scope.data.value.push(vuln.count);
29 $scope.data.key.push(vuln.status);
30
31 $scope.data.colors.push(vulnerabilityColors[vuln.status]);
32 });
33
34 $scope.loaded = true;
35 });
16 $scope.$watch(function() {
17 return dashboardSrv.props.confirmed;
18 }, function(newValue, oldValue) {
19 if (oldValue != newValue)
20 $scope.loadData();
21 }, true);
3622 }
3723 };
3824
25 $scope.loadData = function(){
26 dashboardSrv.getVulnerabilitiesGroupedBy($scope.workspace, 'status', dashboardSrv.props.confirmed)
27 .then(function(vulnsByStatus) {
28 $scope.data = {key: [], value: [], colors: [], options: {maintainAspectRatio: false, animateRotate: true}};
29 $scope.loaded = true;
30
31 vulnerabilityColors = {
32 'open': '#e77273',
33 'closed': '#bddd72',
34 're-opened': '#e7d174',
35 'risk-accepted': '#7aabd9'
36 };
37
38 vulnsByStatus.forEach(function(vuln, index) {
39 $scope.data.value.push(vuln.count);
40 $scope.data.key.push(vuln.status);
41
42 $scope.data.colors.push(vulnerabilityColors[vuln.status]);
43 });
44
45 $scope.loaded = true;
46 });
47 }
48
49 dashboardSrv.registerCallback($scope.loadData);
3950 init();
4051 }]);
4040 </div>
4141 </div>
4242
43 <div class="modal-footer">
43 <div class="modal-footer btn-group">
4444 <button class="btn btn-success" ng-click="ok()">OK</button>
4545 </div>
1414 <div class='main box'>
1515 <div ng-repeat="(severity, count) in vulns" class="bg-white col-lg-2 col-md-2 col-sm-2 col-xs-3 cursor m0 p0" ng-class="{'border-right': $last === false}">
1616 <article class="dato2 bg-white" ng-click="navigate('/status/ws/'+workspace+'/search/severity='+severity)">
17 <section>
17 <section style="padding:10px;">
1818 <div class="nro text-{{severity}}">{{count}}</div>
1919 <div class="txt text-{{severity}}">{{severity}}</div>
2020 </section>
55 <article id='cake' class='panel m0' ng-class="{'height-auto': loaded === true && data.value.length === 0}">
66 <header>
77 <h2>Vulnerabilities
8 <span class="glyphicon glyphicon-info-sign" uib-tooltip="Vulnerabilty distribution for current WS"></span>
8 <span class="glyphicon glyphicon-info-sign" uib-tooltip="Vulnerability distribution for current WS"></span>
99 </h2>
1010 </header>
1111 <span id="cakeText"></span>
207207 return deferred.promise;
208208 };
209209
210 dashboardSrv.getVulnerabilitiesGroupedBy = function(ws, groupBy) {
211 var deferred = $q.defer();
212
213 ServerAPI.getVulnsGroupedBy(ws, groupBy)
210 dashboardSrv.getVulnerabilitiesGroupedBy = function(ws, groupBy, confirmed) {
211 var deferred = $q.defer();
212
213 ServerAPI.getVulnsGroupedBy(ws, groupBy, confirmed)
214214 .then(function(res) {
215215 deferred.resolve(res.data.groups);
216216 }, function() {
1313 </button>
1414 </div>
1515 <div class="control-wrapper control-edit">
16 <button type="button" class="btn edit" title="Edit selected hosts" ng-disabled="selectedHosts().length > 1" ng-click="edit()">
16 <button type="button" class="btn btn-default edit" title="Edit selected hosts" ng-disabled="selectedHosts().length > 1" ng-click="edit()">
1717 <img src="images/icon-toolbar-edit.svg" class="edit-icon" />
1818 </button>
1919 </div>
2020 <div class="control-wrapper">
21 <button type="button" class="btn" title="Delete selected items" ng-click="delete()">
21 <button type="button" class="btn btn-default" title="Delete selected items" ng-click="delete()">
2222 <img src="images/icon-toolbar-delete.svg" class="delete-icon" />
2323 </button>
2424 </div>
1414 </button>
1515 </div>
1616 <div class="control-wrapper control-edit">
17 <button type="button" class="btn edit" title="Edit selected licenses" ng-disabled="selectedLicenses().length > 1" ng-click="edit()">
17 <button type="button" class="btn btn-default edit" title="Edit selected licenses" ng-disabled="selectedLicenses().length > 1" ng-click="edit()">
1818 <img src="images/icon-toolbar-edit.svg" class="edit-icon" />
1919 </button>
2020 </div>
2121 <div class="control-wrapper">
22 <button type="button" class="btn" title="Delete selected licenses" ng-click="delete()">
22 <button type="button" class="btn btn-default " title="Delete selected licenses" ng-click="delete()">
2323 <img src="images/icon-toolbar-delete.svg" class="delete-icon" />
2424 </button>
2525 </div>
5656 var deferred = $q.defer(),
5757 self = this;
5858
59 var url = APIURL + "licenses/" + self._id;
59 var url = APIURL + "licenses/" + self._id + "/";
6060
6161 $http.delete(url)
6262 .then(function(resp) {
7070 update: function(data) {
7171 var deferred = $q.defer(),
7272 self = this;
73 var url = APIURL + "licenses/" + self._id;
73 var url = APIURL + "licenses/" + self._id + "/";
7474
7575 $http.put(url, data)
7676 .then(function(res) {
3434 timestamp = date.getTime()/1000.0;
3535
3636 for (var i = 0; i < $scope.servicesSelected.length; i++) {
37 console.log($scope.servicesSelected[i]._id);
3837 updateAll.push(servicesManager.getService($scope.servicesSelected[i]._id, ws, false).then(function(serviceObj){
39 console.log(serviceObj._id);
4038 $scope.data['_id'] = serviceObj._id;
4139 return servicesManager.updateService(serviceObj, $scope.data, $routeParams.wsId);
4240 }));
162162 vm.openEvidence = function(name) {
163163 var currentEvidence = vm.data._attachments[name];
164164 if (!currentEvidence.newfile)
165 window.open(vm.baseurl + $routeParams.wsId + '/' + vm.data._id + '/' + encodeURIComponent(name), '_blank');
165 window.open(vm.baseurl + '_api/v2/ws/' + $routeParams.wsId + '/vulns/' + vm.data._id + '/attachment/' + encodeURIComponent(name), '_blank');
166166 };
167167
168168 vm.newPolicyViolation = function() {
3737 var searchFilter = {};
3838 var paginationOptions = {
3939 page: 1,
40 pageSize: 10,
40 pageSize: 100,
4141 defaultPageSizes: [10, 50, 75, 100],
4242 sortColumn: null,
4343 sortDirection: null
4545
4646 var init = function() {
4747 $scope.baseurl = BASEURL;
48 console.log($scope.baseurl);
4948 $scope.severities = SEVERITIES;
5049 $scope.easeofresolution = EASEOFRESOLUTION;
5150 $scope.propertyGroupBy = $routeParams.groupbyId;
487486 column.grouping = { groupPriority: 0 };
488487 paginationOptions.sortColumn = colname;
489488 paginationOptions.sortDirection = 'asc';
489 }else if (colname === 'sev' && $scope.propertyGroupBy === 'severity'){
490 // Ugly ugly hack so I don't have to change the displayName of
491 // severity from "sev" to "severity"
492 column.grouping = { groupPriority: 0 };
493 paginationOptions.sortColumn = 'severity';
494 paginationOptions.sortDirection = 'asc'
490495 }
491496 }
492497 };
594599 vuln.exploitation = vuln.severity;
595600 vuln.description = vuln.desc;
596601 vuln.desc_summary = vuln.desc;
602 vuln.references = vuln.refs;
597603 promises.push(self.vulnModelsManager.create(vuln, true));
598604 });
599605 $q.all(promises).then(function(success) {
967973 });
968974 modal.result.then(function(data) {
969975 $scope.getCurrentSelection().forEach(function(vuln) {
970 var references = vuln.refs.concat([]);
971 data.refs.forEach(function(ref) {
972 if(vuln.refs.indexOf(ref) == -1){
973 references.push(ref);
974 }
975 });
976 data.refs = references;
977
978976 vulnsManager.updateVuln(vuln, data).then(function(vulns){
979977 }, function(errorMsg){
980978 // TODO: show errors somehow
11231121 withCredentials: false,
11241122 headers: {'Content-Type': undefined},
11251123 responseType: "arraybuffer",
1126 params: {
1127 fd
1128 }
11291124 }).then(
11301125 function(d) {
11311126 $location.path("/dashboard/ws/" + $routeParams.wsId);
11321127 },
11331128 function(d){
1134 commonsFact.showMessage("Error uploading report");
1129 commonsFact.showMessage("Error uploading report");
11351130 }
11361131 );
11371132 };
33
44 <form name="form" novalidate>
55 <div class="modal-header">
6 <div class="modal-button">
6 <div class="modal-button btn-toolbar">
77 <button class="btn btn-success" ng-click="modal.ok()" ng-disabled="form.$invalid || modal.data.severity === undefined || (modal.data.type === 'VulnerabilityWeb' && modal.host_parents) || modal.data.parents.length == 0">OK</button>
88 <button class="btn btn-danger" ng-click="modal.cancel()">Cancel</button>
99 </div>
247247 </div><!-- #evidenceFiles -->
248248 </div><!-- .modal-body -->
249249 <div class="modal-footer">
250 <div class="modal-button">
250 <div class="modal-button btn-toolbar">
251251 <button class="btn btn-success" ng-click="modal.ok()" ng-disabled="form.$invalid || modal.data.severity === undefined || (modal.data.type === 'VulnerabilityWeb' && modal.host_parents) || modal.data.parents.length == 0">OK</button>
252252 <button class="btn btn-danger" ng-click="modal.cancel()">Cancel</button>
253253 </div>
1313 </button>
1414 </div>
1515 <div class="control-wrapper control-edit">
16 <button type="button" class="btn edit" title="Edit selected vulns" ng-click="edit()" ng-disabled="getCurrentSelection().length != 1">
16 <button type="button" class="btn btn-default edit" title="Edit selected vulns" ng-click="edit()" ng-disabled="getCurrentSelection().length != 1">
1717 <img src="images/icon-toolbar-edit.svg" class="edit-icon" />
1818 </button>
1919 <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="SingleActions" ng-show="getCurrentSelection().length === 1">
2323 <li><a class="ws" ng-click="saveAsModel()">Create template</a></li>
2424 <li><a class="ws" ng-click="showExploits()">Search exploits</a></li>
2525 </ul>
26 <button type="button" class="btn dropdown-toggle" data-toggle="dropdown" title="Actions" ng-hide="getCurrentSelection().length < 2">
26 <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" title="Actions" ng-hide="getCurrentSelection().length < 2">
2727 <span class="caret"></span>
2828 </button>
2929 <ul class="dropdown-menu dropdown-menu-right" role="menu" ng-show="getCurrentSelection().length >= 2">
5555 </ul>
5656 </div>
5757 <div class="control-wrapper">
58 <button type="button" class="btn" title="Delete selected items" ng-click="delete()">
58 <button type="button" class="btn btn-default" title="Delete selected items" ng-click="delete()">
5959 <img src="images/icon-toolbar-delete.svg" class="delete-icon" />
6060 </button>
6161 </div>
7373 </form>
7474 </div>
7575 <div class="control-wrapper filter-wrapper">
76 <button type="button" class="btn confirm-button" title="{{ confirmed === true ? 'All vulns' : 'Confirmed vulns' }}" ng-click="toggleFilter()">
76 <button type="button" class="btn btn-default confirm-button" title="{{ confirmed === true ? 'All vulns' : 'Confirmed vulns' }}" ng-click="toggleFilter()">
7777 <img ng-src="{{ (confirmed === true) ? 'images/icon-toolbar-confirmed-on.svg' : 'images/icon-toolbar-confirmed-off.svg'}}" class="confirm-icon" ng-style="{ 'opacity': (confirmed === true) ? '1' : '0.7' }" />
7878 </button>
7979 </div>
8080 <div class="control-wrapper download-wrapper">
81 <button file-exporter="csv()" type="button" class="btn" title="Download CSV for current workspace">
81 <button file-exporter="csv()" type="button" class="btn btn-default" title="Download CSV for current workspace">
8282 <img src="images/icon-toolbar-download.svg" class="download-icon" />
8383 </button>
8484 </div>
8585 <div class="control-wrapper download-wrapper" ng-hide="fileUploadEnabled === true">
86 <button ng-click="enableFileUpload()" type="button" class="btn" title="Upload a report">
87 <img src="images/icon-toolbar-download.svg" class="download-icon rotate-180"/>
86 <button ng-click="enableFileUpload()" type="button" class="btn btn-default" title="Upload a report">
87 <img src="images/icon-toolbar-upload.svg"/>
8888 </button>
8989 </div>
9090 <div class="pl" ng-show="fileUploadEnabled === true">
00 <div class="ui-grid-cell-contents center" uib-tooltip="{{grid.appScope.concatForTooltip(COL_FIELD,false) | decodeURIComponent}}">
1 <span ng-repeat="(key, value) in COL_FIELD" class='pos-middle crop-text'><a href='{{grid.appScope.baseurl}}{{grid.appScope.workspace}}/{{row.entity._id}}/{{key | encodeURIComponent}}' target='_blank'>{{key | decodeURIComponent}}</a>&nbsp;</span>
1 <span ng-repeat="(key, value) in COL_FIELD" class='pos-middle crop-text'><a href='{{grid.appScope.baseurl}}_api/v2/ws/{{grid.appScope.workspace}}/vulns/{{row.entity._id}}/attachment/{{key | encodeURIComponent}}/' target='_blank'>{{key | decodeURIComponent}}</a>&nbsp;</span>
22 </div>
3 <div ng-if="row.groupHeader && col.grouping.groupPriority !== undefined">{{COL_FIELD CUSTOM_FILTERS}}</div>
3 <div ng-if="row.groupHeader && col.grouping.groupPriority !== undefined">{{COL_FIELD CUSTOM_FILTERS}}</div>
33
44 <form name="form" ng-submit="ok()" novalidate>
55 <div class="modal-header">
6 <div class="modal-button">
6 <div class="modal-button btn-toolbar">
77 <button class="btn btn-success" ng-click="ok()" ng-disabled="form.$invalid">OK</button>
88 <button type="button" class="btn btn-danger" ng-click="cancel()">Cancel</button>
99 </div>
5555 </div><!-- .form-horizontal -->
5656 </div><!-- .modal-body -->
5757 <div class="modal-footer">
58 <div class="modal-button">
58 <div class="modal-button btn-toolbar">
5959 <button class="btn btn-success" ng-disabled="form.$invalid || (data.name == '')" ng-click="ok()">OK</button>
6060 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
6161 </div>
33
44 <form name="form" novalidate>
55 <div class="modal-header">
6 <div class="modal-button">
6 <div class="modal-button btn-toolbar">
77 <button class="btn btn-success" ng-click="ok()" ng-disabled="form.$invalid || (data.name == '') || (data.exploitation === '')">OK</button>
88 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
99 </div>
6161 </div><!-- .form-horizontal -->
6262 </div><!-- .modal-body -->
6363 <div class="modal-footer">
64 <div class="modal-button">
64 <div class="modal-button btn-toolbar">
6565 <button class="btn btn-success" ng-disabled="form.$invalid || (data.name == '') || (data.exploitation === '')" ng-click="ok()">OK</button>
6666 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
6767 </div>
1414 </button>
1515 </div>
1616 <div class="control-wrapper control-edit">
17 <button type="button" class="btn edit" title="Edit selected vulns" ng-click="disabledClick || edit()">
17 <button type="button" class="btn btn-default edit" title="Edit selected vulns" ng-click="disabledClick || edit()">
1818 <img src="images/icon-toolbar-edit.svg" class="edit-icon" />
1919 </button>
2020 </div>
2121 <div class="control-wrapper">
22 <button id="delete" type="button" class="btn" title="Delete selected items" ng-click="disabledClick || delete()">
22 <button id="delete" type="button" class="btn btn-default" title="Delete selected items" ng-click="disabledClick || delete()">
2323 <img src="images/icon-toolbar-delete.svg" class="delete-icon" />
2424 </button>
2525 </div>
4747 <table class="table-v3 licenses-list table table-responsive">
4848 <thead>
4949 <tr class="ui-grid-header">
50 <th class="ui-grid-cell-contents ui-grid-header-cell hosts-list-checkall">
50 <th class="ui-grid-cell-contents checkbox-select ui-grid-header-cell">
5151 <input type="checkbox" ng-model="selectall" ng-click="disabledClick || checkAll()"/>
5252 </th>
5353 <th class="ui-grid-cell-contents ui-grid-header-cell">
9898 }
9999 var message;
100100 if (res.status == 409) {
101 console.log("Vulnerability template already exists. " + res.data.message + " ID: " + res.data.object._id);
102 deferred.resolve(self);
101 message = "Vulnerability template already exists. " + res.data.message + " ID: " + res.data.object._id;
103102 } else {
104103 message = "Unable to save the Vuln Model. " + msg;
105104 }
66 ['Vuln', 'WebVuln', '$q', 'ServerAPI', 'commonsFact', 'workspacesFact',
77 function(Vuln, WebVuln, $q, ServerAPI, commonsFact, workspacesFact) {
88 var vulnsManager = {};
9 var vulnsCounter = 0;
9 var vulnsCounter = -1;
1010 var totalVulns = 0;
1111
1212 vulnsManager.createVuln = function(ws, data) {
8181 };
8282
8383 vulnsManager.getVulnsNum = function(ws) {
84 if( vulnsCounter > 0) {
84 if( vulnsCounter > -1) {
8585 return vulnsCounter;
8686 }else{
8787 return totalVulns;
8888 }
89 };
90
91 vulnsManager.getTotalVulns = function(ws) {
92 return totalVulns;
8993 };
9094
9195 vulnsManager.updateVuln = function(vuln, data) {
1717 </button>
1818 </div>
1919 <div class="control-wrapper control-edit">
20 <button type="button" class="btn edit" title="Edit selected Workspaces" ng-click="edit()">
20 <button type="button" class="btn btn-default edit" title="Edit selected Workspaces" ng-click="edit()">
2121 <img src="images/icon-toolbar-edit.svg" class="edit-icon" />
2222 </button>
2323 </div>
2424 <div class="control-wrapper">
25 <button id="delete" type="button" class="btn" title="Delete selected Workspaces" ng-click="delete()">
25 <button id="delete" type="button" class="btn btn-default" title="Delete selected Workspaces" ng-click="delete()">
2626 <img src="images/icon-toolbar-delete.svg" class="delete-icon" />
2727 </button>
2828 </div>
33
44 <form novalidate>
55 <div class="modal-header">
6 <div class="modal-button">
6 <div class="modal-button btn-toolbar">
77 <button class="btn btn-success" ng-click="okEdit()" ng-disabled="form.$invalid || date.$invalid">OK</button>
88 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
99 </div>
1313 <div class="form-horizontal">
1414 <div class="form-group" ng-class="{'has-error': form.name.$invalid }">
1515 <div class="col-md-12">
16 <ng-form name="form" novalidate>
16 <ng-form name="form" novalidate>
1717 <label class="sr-only" for="wsp-name">Workspace Name</label>
1818 <input type="text" class="form-control"
1919 ng-pattern=/^[a-z][a-z0-9\_\$\(\)\+\-\/]*$/ id="vuln-name" name="name" placeholder="Workspace Name"
33
44 <form name="form" novalidate>
55 <div class="modal-header">
6 <div class="modal-button">
6 <div class="modal-button btn-toolbar">
77 <button class="btn btn-success" ng-disabled="form.$invalid || date.$invalid" ng-click="okNew()">Save</button>
88 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
99 </div>
1313 <div class="form-horizontal">
1414 <div class="form-group" ng-class="{'has-error': form.name.$invalid }">
1515 <div class="col-md-12">
16 <ng-form name="form" novalidate>
16 <ng-form name="form" novalidate>
1717 <label class="sr-only" for="wsp-name">Workspace Name</label>
1818 <input type="text" class="form-control"
1919 ng-pattern=/^[a-z][a-z0-9\_\$\(\)\+\-\/]*$/ id="vuln-name" name="name" placeholder="Workspace Name"
11 let
22 in
33 mkShell {
4 buildInputs = with (import ./default.nix);
5 [server python.interpreter];
4 buildInputs = with python27Packages;
5 [virtualenv pyopenssl psycopg2 pillow pygobject3
6 gobjectIntrospection gtk3 gnome3.vte
7 ];
8 shellHook = ''
9 unset SOURCE_DATE_EPOCH # Required to make pip work
10
11 mkvirtualenv(){
12 # Reset previous virtualenv
13 type -t deactivate && deactivate
14 rm -rf venv
15
16 # Build new virtualenv with system packages
17 virtualenv --system-site-packages venv
18 source venv/bin/activate
19 pip install -r requirements_server.txt
20 pip install -r requirements.txt
21 pip install -r requirements_dev.txt
22 }
23
24 if [[ -d venv ]]; then
25 source venv/bin/activate
26 else
27 echo Creating new virtualenv
28 mkvirtualenv
29 fi
30
31 # Without this, the import report dialog of the client breaks
32 # Taken from https://github.com/NixOS/nixpkgs/pull/26614
33 export XDG_DATA_DIRS=$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH\''${XDG_DATA_DIRS:+:}\$XDG_DATA_DIRS
34
35 alias c="PS1= python faraday.py"
36
37 '';
638 }
5858 _app_ctx_stack.top.sqlalchemy_queries = []
5959
6060 ret = super(CustomClient, self).open(*args, **kwargs)
61 if ret.headers.get('content-type') == 'application/json':
62 try:
63 ret.json = json.loads(ret.data)
64 except ValueError:
65 ret.json = None
61 #Now set in flask 1.0
62 #if ret.headers.get('content-type') == 'application/json':
63 # try:
64 # ret.json = json.loads(ret.data)
65 # except ValueError:
66 # ret.json = None
6667 return ret
6768
6869
66 import random
77 import pytest
88 from functools import partial
9 from server.models import Hostname
10
9 from server.models import Hostname, Host
10
11 from server.api.modules.hosts import HostsView
12
13 from test_cases.test_api_workspaced_base import (
14 ReadOnlyAPITests)
15 from test_cases import factories
16 from test_cases.factories import WorkspaceFactory
1117
1218 @pytest.mark.parametrize(
1319 "with_host_vulns,with_service_vulns", [[True, False],
119125 session.commit()
120126 assert len(host.hostnames) == 1
121127 assert host.hostnames[0].name == 'y'
128
129 HOST_TO_QUERY_AMOUNT = 3
130 HOST_NOT_TO_QUERY_AMOUNT = 2
131 SERVICE_BY_HOST = 3
132 VULN_BY_HOST = 2
133 VULN_BY_SERVICE = 1
134
135 class TestHostAPI(ReadOnlyAPITests):
136 model = Host
137 factory = factories.HostFactory
138 api_endpoint = 'hosts'
139 view_class = HostsView
140
141 # This test the api endpoint for some of the host in the ws, with existing other host with vulns in the same and
142 # other ws
143 @pytest.mark.parametrize('querystring', ['countVulns/?hosts={}',
144 ])
145 def test_vuln_count(self,
146 vulnerability_factory,
147 host_factory,
148 service_factory,
149 workspace_factory,
150 test_client,
151 session,
152 querystring):
153
154 workspace1 = workspace_factory.create()
155 workspace2 = workspace_factory.create()
156 session.add(workspace1)
157 session.add(workspace2)
158 session.commit()
159
160 hosts_to_query = host_factory.create_batch(HOST_TO_QUERY_AMOUNT, workspace=workspace1)
161 hosts_not_to_query = host_factory.create_batch(HOST_NOT_TO_QUERY_AMOUNT, workspace=workspace1)
162 hosts_not_to_query_w2 = host_factory.create_batch(HOST_NOT_TO_QUERY_AMOUNT, workspace=workspace2)
163 hosts = hosts_to_query + hosts_not_to_query + hosts_not_to_query_w2
164
165 services = []
166 vulns = []
167
168 session.add_all(hosts)
169
170 for host in hosts:
171 services += service_factory.create_batch(SERVICE_BY_HOST, host=host, workspace=host.workspace)
172 vulns += vulnerability_factory.create_batch(VULN_BY_HOST, host=host, service=None, workspace=host.workspace)
173
174 session.add_all(services)
175
176 for service in services:
177 vulns += vulnerability_factory.create_batch(VULN_BY_SERVICE, service=service, host=None,
178 workspace=service.workspace)
179
180 session.add_all(vulns)
181 session.commit()
182
183 url = self.url(workspace=workspace1) + querystring.format(",".join(map(lambda x: str(x.id), hosts_to_query)))
184 res = test_client.get(url)
185
186 assert res.status_code == 200
187
188 for host in hosts_to_query:
189 assert res.json['hosts'][str(host.id)]['total'] == VULN_BY_HOST + VULN_BY_SERVICE * SERVICE_BY_HOST
190 assert str(host.id) in res.json['hosts']
191
192 # This test the api endpoint for some of the host in the ws, with existing other host in other ws and ask for the
193 # other hosts and test the api endpoint for all of the host in the ws, retrieving all host when none is required
194 @pytest.mark.parametrize('querystring', [ 'countVulns/?hosts={}', 'countVulns/',
195 ])
196 def test_vuln_count_ignore_other_ws(self,
197 vulnerability_factory,
198 host_factory,
199 service_factory,
200 workspace_factory,
201 test_client,
202 session,
203 querystring):
204
205 workspace1 = workspace_factory.create()
206 workspace2 = workspace_factory.create()
207 session.add(workspace1)
208 session.add(workspace2)
209 session.commit()
210
211 hosts_to_query = host_factory.create_batch(HOST_TO_QUERY_AMOUNT, workspace=workspace1)
212 hosts_not_to_query_w2 = host_factory.create_batch(HOST_NOT_TO_QUERY_AMOUNT, workspace=workspace2)
213 hosts = hosts_to_query + hosts_not_to_query_w2
214
215 services = []
216 vulns = []
217
218 session.add_all(hosts)
219
220 for host in hosts:
221 services += service_factory.create_batch(SERVICE_BY_HOST, host=host, workspace=host.workspace)
222 vulns += vulnerability_factory.create_batch(VULN_BY_HOST, host=host, service=None, workspace=host.workspace)
223
224 session.add_all(services)
225
226 for service in services:
227 vulns += vulnerability_factory.create_batch(VULN_BY_SERVICE, service=service, host=None, workspace=service.workspace)
228
229 session.add_all(vulns)
230 session.commit()
231
232 url = self.url(workspace=workspace1) + querystring.format(",".join(map(lambda x: str(x.id), hosts)))
233 res = test_client.get(url)
234
235 assert res.status_code == 200
236 assert len(res.json['hosts']) == HOST_TO_QUERY_AMOUNT
237
238 for host in hosts_to_query:
239 assert res.json['hosts'][str(host.id)]['total'] == VULN_BY_HOST + VULN_BY_SERVICE * SERVICE_BY_HOST
240 assert str(host.id) in res.json['hosts']
241
242 for host in hosts_not_to_query_w2:
243 assert str(host.id) not in res.json['hosts']
4444 from test_cases.factories import ServiceFactory, CommandFactory, \
4545 CommandObjectFactory, HostFactory, EmptyCommandFactory, \
4646 UserFactory, VulnerabilityWebFactory, VulnerabilityFactory, \
47 ReferenceFactory, PolicyViolationFactory, HostnameFactory
47 ReferenceFactory, PolicyViolationFactory, HostnameFactory, WorkspaceFactory
4848
4949 CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
5050
337337 assert res.status_code == 200
338338 assert res.data == file_content
339339
340 res = test_client.get(
341 self.url() +
342 '{0}/attachment/notexistingattachment.png/'.format(vuln_id))
343 assert res.status_code == 404
344
340345 @ignore_nplusone
341346 def test_update_vuln_add_attachment_on_update(self, test_client, session):
342347 host = HostFactory.create(workspace=self.workspace)
14461451 session.commit()
14471452 res = test_client.get(self.url(workspace=vuln.workspace) + '?id={0}'.format(vuln.id))
14481453 assert res.json['count'] == 1
1449 res.json['vulnerabilities'][0]['value']['name'] == vuln.name
1454 assert res.json['vulnerabilities'][0]['value']['name'] == vuln.name
1455
1456 def test_search_by_hostnames_service_case(self, session, test_client):
1457 workspace = WorkspaceFactory.create()
1458 vuln2 = VulnerabilityFactory.create(workspace=workspace)
1459 hostname = HostnameFactory.create(workspace=workspace, name='test.com')
1460 host = HostFactory.create(workspace=workspace)
1461 host.hostnames.append(hostname)
1462 service = ServiceFactory.create(workspace=workspace, host=host)
1463 vuln = VulnerabilityFactory.create(service=service, host=None, workspace=workspace)
1464 session.add(vuln)
1465 session.add(vuln2)
1466 session.add(service)
1467 session.add(hostname)
1468 session.commit()
1469 url = self.url(workspace=workspace) + '?hostnames={0}'.format(hostname.name)
1470 res = test_client.get(url)
1471
1472 assert res.status_code == 200
1473 assert res.json['count'] == 1
1474 assert res.json['vulnerabilities'][0]['value']['name'] == vuln.name
1475
1476 def test_search_by_hostnames_host_case(self, session, test_client):
1477 workspace = WorkspaceFactory.create()
1478 vuln2 = VulnerabilityFactory.create(workspace=workspace)
1479 hostname = HostnameFactory.create(workspace=workspace, name='test.com')
1480 host = HostFactory.create(workspace=workspace)
1481 host.hostnames.append(hostname)
1482 vuln = VulnerabilityFactory.create(host=host, service=None, workspace=workspace)
1483 session.add(vuln)
1484 session.add(vuln2)
1485 session.add(host)
1486 session.add(hostname)
1487 session.commit()
1488 url = self.url(workspace=workspace) + '?hostnames={0}'.format(hostname.name)
1489 res = test_client.get(url)
1490 assert res.status_code == 200
1491 assert res.json['count'] == 1
1492 assert res.json['vulnerabilities'][0]['value']['name'] == vuln.name
14501493
14511494 def test_hostnames_comma_separated(self, test_client, session):
14521495 #Create Host A with hostname HA
14701513 assert res.status_code == 200
14711514 assert res.json['count'] == 2
14721515
1516 def test_missing_policy_violation_case(self, test_client, session):
1517 """
1518 bug found when a json was missing the policyviolations key
1519 """
1520 host = HostFactory.create(workspace=self.workspace)
1521 session.commit()
1522 data = {
1523 'name': 'Test Alert policy_violations',
1524 'severity': 'informational',
1525 'creator': 'Zap',
1526 'parent_type': 'Host',
1527 'parent': host.id,
1528 'type': 'Vulnerability',
1529 'refs': ''
1530 }
1531 res = test_client.post(self.url(), data=data)
1532 assert res.status_code == 201
1533
1534 def test_missing_references_case(self, test_client, session):
1535 """
1536 bug found when a json was missing the policyviolations key
1537 """
1538 host = HostFactory.create(workspace=self.workspace)
1539 session.commit()
1540 data = {
1541 'name': 'Test Alert policy_violations',
1542 'severity': 'informational',
1543 'creator': 'Zap',
1544 'parent_type': 'Host',
1545 'parent': host.id,
1546 'type': 'Vulnerability',
1547 }
1548 res = test_client.post(self.url(), data=data)
1549 assert res.status_code == 201
1550
1551
14731552 def test_type_filter(workspace, session,
14741553 vulnerability_factory,
14751554 vulnerability_web_factory):
15201599 filtered = filter_.filter(VulnerabilityGeneric.query,
15211600 VulnerabilityGeneric,
15221601 'creator',
1523 'metasploit')
1602 'metasp')
15241603 assert {v.id for v in filtered} == {v.id for v in vulns}
15251604
15261605
66 import random
77 import string
88 import mock
9 import os
10 import re
911
1012 from server.config import (
1113 copy_default_config_to_local,
3133 assert copy_default_config_to_local() is None
3234 assert not makedirs.called
3335 assert not copyfile.called
36
37 VERSION_PATTERN = r"""
38 v?
39 (?:
40 (?:(?P<epoch>[0-9]+)!)? # epoch
41 (?P<release>[0-9]+(?:\.[0-9]+)*) # release segment
42 (?P<pre> # pre-release
43 [-_\.]?
44 (?P<pre_l>(a|b|c|rc|alpha|beta|pre|preview))
45 [-_\.]?
46 (?P<pre_n>[0-9]+)?
47 )?
48 (?P<post> # post release
49 (?:-(?P<post_n1>[0-9]+))
50 |
51 (?:
52 [-_\.]?
53 (?P<post_l>post|rev|r)
54 [-_\.]?
55 (?P<post_n2>[0-9]+)?
56 )
57 )?
58 (?P<dev> # dev release
59 [-_\.]?
60 (?P<dev_l>dev)
61 [-_\.]?
62 (?P<dev_n>[0-9]+)?
63 )?
64 )
65 (?:\+(?P<local>[a-z0-9]+(?:[-_\.][a-z0-9]+)*))? # local version
66 """
67
68 _regex = re.compile(
69 r"^\s*" + VERSION_PATTERN + r"\s*$",
70 re.VERBOSE | re.IGNORECASE,
71 )
72
73 def isPEP440(arg):
74 return not _regex.match(arg) is None
75
76
77 def test_exists_and_content():
78 f = open(os.path.join(os.getcwd(),"..","VERSION"),"r")
79 line1 = f.readline().rstrip()
80 assert f.read() == ''
81 assert isPEP440(line1)
5252 responses.add(responses.PUT, url, status=409,
5353 content_type="application/json", json={'error': 'conflict'})
5454 with self.assertRaises(server_io_exceptions.ConflictInDatabase):
55 server._unsafe_io_with_server(requests.put, 200, url, json={"name": "betcha"})
55 server._unsafe_io_with_server(requests.put, [200], url, json={"name": "betcha"})
5656
5757 @responses.activate
5858 def test_raise_resource_does_not_exist(self):
5959 url = "http://dont_exist.com"
6060 responses.add(responses.GET, url, body='{"name": "betcha"}', status=404)
6161 with self.assertRaises(server_io_exceptions.ResourceDoesNotExist):
62 server._unsafe_io_with_server(requests.get, 200, url, json={"name": "betcha"})
62 server._unsafe_io_with_server(requests.get, [200], url, json={"name": "betcha"})
6363
6464 @responses.activate
6565 def test_raise_unauthorized(self):
6666 url = "http://nope.com"
6767 responses.add(responses.GET, url, body='{"name": "betcha"}', status=403)
6868 with self.assertRaises(server_io_exceptions.Unauthorized):
69 server._unsafe_io_with_server(requests.get, 200, url, json={"name": "betcha"})
69 server._unsafe_io_with_server(requests.get, [200], url, json={"name": "betcha"})
7070 url2 = "http://nope2.com"
7171 responses.add(responses.GET, url2, body='{"name": "betcha"}', status=401)
7272 with self.assertRaises(server_io_exceptions.Unauthorized):
73 server._unsafe_io_with_server(requests.get, 200, url, json={"name": "betcha"})
73 server._unsafe_io_with_server(requests.get, [200], url, json={"name": "betcha"})
7474
7575 @responses.activate
7676 def test_raise_cant_comm_with_server_on_wrong_response_code(self):
7777 url = "http://yes.com"
7878 responses.add(responses.GET, url, status=204)
7979 with self.assertRaises(server_io_exceptions.CantCommunicateWithServerError):
80 server._unsafe_io_with_server(requests.get, 200, url)
80 server._unsafe_io_with_server(requests.get, [200], url)
8181
8282 @responses.activate
8383 def test_server_with_okey_request(self):
8484 url = "http://this-is-ok.com"
8585 responses.add(responses.GET, url, body='{"name": "betcha"}', status=200)
8686 responses.add(responses.PUT, url, body='{"ok": "true"}', status=200)
87 response_get = server._unsafe_io_with_server(requests.get, 200, url)
88 response_put = server._unsafe_io_with_server(requests.put, 200, url)
87 response_get = server._unsafe_io_with_server(requests.get, [200], url)
88 response_put = server._unsafe_io_with_server(requests.put, [200], url)
8989 self.assertEqual(response_get.text, requests.get(url).text)
9090 self.assertEqual(response_put.text, requests.put(url).text)
9191
6161 import pip
6262 modules_info = ",".join([ "%s=%s" % (x.key, x.version)
6363 for x in pip.get_installed_distributions()])
64 except ImportError:
64 except (ImportError, AttributeError):
6565 pass
6666
6767