cve_id
stringlengths
13
16
obtain_all_privilege
stringclasses
3 values
obtain_user_privilege
stringclasses
2 values
obtain_other_privilege
stringclasses
2 values
user_interaction_required
stringclasses
3 values
cvss2_vector_string
stringclasses
106 values
cvss2_access_vector
stringclasses
4 values
cvss2_access_complexity
stringclasses
4 values
cvss2_authentication
stringclasses
3 values
cvss2_confidentiality_impact
stringclasses
4 values
cvss2_integrity_impact
stringclasses
4 values
cvss2_availability_impact
stringclasses
4 values
cvss2_base_score
stringclasses
50 values
cvss3_vector_string
stringclasses
226 values
cvss3_attack_vector
stringclasses
5 values
cvss3_attack_complexity
stringclasses
3 values
cvss3_privileges_required
stringclasses
4 values
cvss3_user_interaction
stringclasses
3 values
cvss3_scope
stringclasses
3 values
cvss3_confidentiality_impact
stringclasses
4 values
cvss3_integrity_impact
stringclasses
4 values
cvss3_availability_impact
stringclasses
4 values
cvss3_base_score
stringclasses
55 values
cvss3_base_severity
stringclasses
5 values
exploitability_score
stringclasses
22 values
impact_score
stringclasses
15 values
ac_insuf_info
stringclasses
3 values
reference_json
stringlengths
221
23.3k
problemtype_json
stringclasses
200 values
severity
stringclasses
4 values
cve_nodes
stringlengths
2
33.1k
cve_description
stringlengths
64
1.99k
cve_last_modified_date
stringlengths
17
17
cve_published_date
stringlengths
17
17
cwe_name
stringclasses
125 values
cwe_description
stringclasses
124 values
cwe_extended_description
stringclasses
95 values
cwe_url
stringclasses
124 values
cwe_is_category
int64
0
1
commit_author
stringlengths
0
34
commit_author_date
stringlengths
25
25
commit_msg
stringlengths
0
13.3k
commit_hash
stringlengths
40
40
commit_is_merge
stringclasses
1 value
repo_name
stringclasses
467 values
repo_description
stringclasses
459 values
repo_date_created
stringclasses
467 values
repo_date_last_push
stringclasses
467 values
repo_homepage
stringclasses
294 values
repo_owner
stringclasses
470 values
repo_stars
stringclasses
406 values
repo_forks
stringclasses
352 values
function_name
stringlengths
3
120
function_signature
stringlengths
6
640
function_parameters
stringlengths
2
302
function
stringlengths
12
114k
function_token_count
stringlengths
1
5
function_before_change
stringclasses
1 value
labels
int64
1
1
CVE-2019-19947
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:N
LOCAL
LOW
NONE
PARTIAL
NONE
NONE
2.1
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
PHYSICAL
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
4.6
MEDIUM
0.9
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/da2311a6385c3b499da2ed5d9be59ce331fa93e9', 'name': 'https://github.com/torvalds/linux/commit/da2311a6385c3b499da2ed5d9be59ce331fa93e9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/12/24/1', 'name': '[oss-security] 20191224 CVE-2019-19947: Linux kernel can: kvaser_usb: kvaser_usb_leaf: some info-leaks vulnerabilities', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00013.html', 'name': '[debian-lts-announce] 20200118 [SECURITY] [DLA 2068-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200204-0002/', 'name': 'https://security.netapp.com/advisory/ntap-20200204-0002/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://usn.ubuntu.com/4285-1/', 'name': 'USN-4285-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/03/msg00001.html', 'name': '[debian-lts-announce] 20200302 [SECURITY] [DLA 2114-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/4284-1/', 'name': 'USN-4284-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4427-1/', 'name': 'USN-4427-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4485-1/', 'name': 'USN-4485-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.4.6', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In the Linux kernel through 5.4.6, there are information leaks of uninitialized memory to a USB device in the drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c driver, aka CID-da2311a6385c.'}]
2020-09-15T18:15Z
2019-12-24T00:15Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
Xiaolong Huang
2019-12-07 22:40:24+08:00
can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices Uninitialized Kernel memory can leak to USB devices. Fix this by using kzalloc() instead of kmalloc(). Signed-off-by: Xiaolong Huang <[email protected]> Fixes: 7259124eac7d ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c") Cc: linux-stable <[email protected]> # >= v4.19 Signed-off-by: Marc Kleine-Budde <[email protected]>
da2311a6385c3b499da2ed5d9be59ce331fa93e9
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
kvaser_usb_leaf_flush_queue
kvaser_usb_leaf_flush_queue( struct kvaser_usb_net_priv * priv)
['priv']
static int kvaser_usb_leaf_flush_queue(struct kvaser_usb_net_priv *priv) { struct kvaser_cmd *cmd; int rc; cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); if (!cmd) return -ENOMEM; cmd->id = CMD_FLUSH_QUEUE; cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_flush_queue); cmd->u.flush_queue.channel = priv->channel; cmd->u.flush_queue.flags = 0x00; rc = kvaser_usb_send_cmd(priv->dev, cmd, cmd->len); kfree(cmd); return rc; }
102
True
1
CVE-2019-19947
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:N
LOCAL
LOW
NONE
PARTIAL
NONE
NONE
2.1
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
PHYSICAL
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
4.6
MEDIUM
0.9
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/da2311a6385c3b499da2ed5d9be59ce331fa93e9', 'name': 'https://github.com/torvalds/linux/commit/da2311a6385c3b499da2ed5d9be59ce331fa93e9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/12/24/1', 'name': '[oss-security] 20191224 CVE-2019-19947: Linux kernel can: kvaser_usb: kvaser_usb_leaf: some info-leaks vulnerabilities', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00013.html', 'name': '[debian-lts-announce] 20200118 [SECURITY] [DLA 2068-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200204-0002/', 'name': 'https://security.netapp.com/advisory/ntap-20200204-0002/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://usn.ubuntu.com/4285-1/', 'name': 'USN-4285-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/03/msg00001.html', 'name': '[debian-lts-announce] 20200302 [SECURITY] [DLA 2114-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/4284-1/', 'name': 'USN-4284-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4427-1/', 'name': 'USN-4427-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4485-1/', 'name': 'USN-4485-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.4.6', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In the Linux kernel through 5.4.6, there are information leaks of uninitialized memory to a USB device in the drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c driver, aka CID-da2311a6385c.'}]
2020-09-15T18:15Z
2019-12-24T00:15Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
Xiaolong Huang
2019-12-07 22:40:24+08:00
can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices Uninitialized Kernel memory can leak to USB devices. Fix this by using kzalloc() instead of kmalloc(). Signed-off-by: Xiaolong Huang <[email protected]> Fixes: 7259124eac7d ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c") Cc: linux-stable <[email protected]> # >= v4.19 Signed-off-by: Marc Kleine-Budde <[email protected]>
da2311a6385c3b499da2ed5d9be59ce331fa93e9
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
kvaser_usb_leaf_set_opt_mode
kvaser_usb_leaf_set_opt_mode( const struct kvaser_usb_net_priv * priv)
['priv']
static int kvaser_usb_leaf_set_opt_mode(const struct kvaser_usb_net_priv *priv) { struct kvaser_cmd *cmd; int rc; cmd = kmalloc(sizeof(*cmd), GFP_KERNEL); if (!cmd) return -ENOMEM; cmd->id = CMD_SET_CTRL_MODE; cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_ctrl_mode); cmd->u.ctrl_mode.tid = 0xff; cmd->u.ctrl_mode.channel = priv->channel; if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) cmd->u.ctrl_mode.ctrl_mode = KVASER_CTRL_MODE_SILENT; else cmd->u.ctrl_mode.ctrl_mode = KVASER_CTRL_MODE_NORMAL; rc = kvaser_usb_send_cmd(priv->dev, cmd, cmd->len); kfree(cmd); return rc; }
134
True
1
CVE-2019-19947
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:N
LOCAL
LOW
NONE
PARTIAL
NONE
NONE
2.1
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
PHYSICAL
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
4.6
MEDIUM
0.9
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/da2311a6385c3b499da2ed5d9be59ce331fa93e9', 'name': 'https://github.com/torvalds/linux/commit/da2311a6385c3b499da2ed5d9be59ce331fa93e9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2019/12/24/1', 'name': '[oss-security] 20191224 CVE-2019-19947: Linux kernel can: kvaser_usb: kvaser_usb_leaf: some info-leaks vulnerabilities', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/01/msg00013.html', 'name': '[debian-lts-announce] 20200118 [SECURITY] [DLA 2068-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200204-0002/', 'name': 'https://security.netapp.com/advisory/ntap-20200204-0002/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://usn.ubuntu.com/4285-1/', 'name': 'USN-4285-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/03/msg00001.html', 'name': '[debian-lts-announce] 20200302 [SECURITY] [DLA 2114-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/4284-1/', 'name': 'USN-4284-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4427-1/', 'name': 'USN-4427-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4485-1/', 'name': 'USN-4485-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.4.6', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In the Linux kernel through 5.4.6, there are information leaks of uninitialized memory to a USB device in the drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c driver, aka CID-da2311a6385c.'}]
2020-09-15T18:15Z
2019-12-24T00:15Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
Xiaolong Huang
2019-12-07 22:40:24+08:00
can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices Uninitialized Kernel memory can leak to USB devices. Fix this by using kzalloc() instead of kmalloc(). Signed-off-by: Xiaolong Huang <[email protected]> Fixes: 7259124eac7d ("can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c") Cc: linux-stable <[email protected]> # >= v4.19 Signed-off-by: Marc Kleine-Budde <[email protected]>
da2311a6385c3b499da2ed5d9be59ce331fa93e9
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
kvaser_usb_leaf_simple_cmd_async
kvaser_usb_leaf_simple_cmd_async( struct kvaser_usb_net_priv * priv , u8 cmd_id)
['priv', 'cmd_id']
static int kvaser_usb_leaf_simple_cmd_async(struct kvaser_usb_net_priv *priv, u8 cmd_id) { struct kvaser_cmd *cmd; int err; cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC); if (!cmd) return -ENOMEM; cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_simple); cmd->id = cmd_id; cmd->u.simple.channel = priv->channel; err = kvaser_usb_send_cmd_async(priv, cmd, cmd->len); if (err) kfree(cmd); return err; }
97
True
1
CVE-2019-20636
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
6.7
MEDIUM
0.8
5.9
False
[{'url': 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cb222aed03d798fc074be55e59d9a112338ee784', 'name': 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cb222aed03d798fc074be55e59d9a112338ee784', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/cb222aed03d798fc074be55e59d9a112338ee784', 'name': 'https://github.com/torvalds/linux/commit/cb222aed03d798fc074be55e59d9a112338ee784', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.12', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.12', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.12', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In the Linux kernel before 5.4.12, drivers/input/input.c has out-of-bounds writes via a crafted keycode table, as demonstrated by input_set_keycode, aka CID-cb222aed03d7.'}]
2020-06-10T13:15Z
2020-04-08T14:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Dmitry Torokhov
2019-12-13 14:56:16-08:00
Input: add safety guards to input_set_keycode() If we happen to have a garbage in input device's keycode table with values too big we'll end up doing clear_bit() with offset way outside of our bitmaps, damaging other objects within an input device or even outside of it. Let's add sanity checks to the returned old keycodes. Reported-by: [email protected] Reported-by: [email protected] Link: https://lore.kernel.org/r/20191207212757.GA245964@dtor-ws Signed-off-by: Dmitry Torokhov <[email protected]>
cb222aed03d798fc074be55e59d9a112338ee784
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
input_default_setkeycode
input_default_setkeycode( struct input_dev * dev , const struct input_keymap_entry * ke , unsigned int * old_keycode)
['dev', 'ke', 'old_keycode']
static int input_default_setkeycode(struct input_dev *dev, const struct input_keymap_entry *ke, unsigned int *old_keycode) { unsigned int index; int error; int i; if (!dev->keycodesize) return -EINVAL; if (ke->flags & INPUT_KEYMAP_BY_INDEX) { index = ke->index; } else { error = input_scancode_to_scalar(ke, &index); if (error) return error; } if (index >= dev->keycodemax) return -EINVAL; if (dev->keycodesize < sizeof(ke->keycode) && (ke->keycode >> (dev->keycodesize * 8))) return -EINVAL; switch (dev->keycodesize) { case 1: { u8 *k = (u8 *)dev->keycode; *old_keycode = k[index]; k[index] = ke->keycode; break; } case 2: { u16 *k = (u16 *)dev->keycode; *old_keycode = k[index]; k[index] = ke->keycode; break; } default: { u32 *k = (u32 *)dev->keycode; *old_keycode = k[index]; k[index] = ke->keycode; break; } } __clear_bit(*old_keycode, dev->keybit); __set_bit(ke->keycode, dev->keybit); for (i = 0; i < dev->keycodemax; i++) { if (input_fetch_keycode(dev, i) == *old_keycode) { __set_bit(*old_keycode, dev->keybit); break; /* Setting the bit twice is useless, so break */ } } return 0; }
303
True
1
CVE-2019-20636
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
6.7
MEDIUM
0.8
5.9
False
[{'url': 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cb222aed03d798fc074be55e59d9a112338ee784', 'name': 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cb222aed03d798fc074be55e59d9a112338ee784', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/cb222aed03d798fc074be55e59d9a112338ee784', 'name': 'https://github.com/torvalds/linux/commit/cb222aed03d798fc074be55e59d9a112338ee784', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.12', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.12', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.12', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In the Linux kernel before 5.4.12, drivers/input/input.c has out-of-bounds writes via a crafted keycode table, as demonstrated by input_set_keycode, aka CID-cb222aed03d7.'}]
2020-06-10T13:15Z
2020-04-08T14:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Dmitry Torokhov
2019-12-13 14:56:16-08:00
Input: add safety guards to input_set_keycode() If we happen to have a garbage in input device's keycode table with values too big we'll end up doing clear_bit() with offset way outside of our bitmaps, damaging other objects within an input device or even outside of it. Let's add sanity checks to the returned old keycodes. Reported-by: [email protected] Reported-by: [email protected] Link: https://lore.kernel.org/r/20191207212757.GA245964@dtor-ws Signed-off-by: Dmitry Torokhov <[email protected]>
cb222aed03d798fc074be55e59d9a112338ee784
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
input_set_keycode
input_set_keycode( struct input_dev * dev , const struct input_keymap_entry * ke)
['dev', 'ke']
int input_set_keycode(struct input_dev *dev, const struct input_keymap_entry *ke) { unsigned long flags; unsigned int old_keycode; int retval; if (ke->keycode > KEY_MAX) return -EINVAL; spin_lock_irqsave(&dev->event_lock, flags); retval = dev->setkeycode(dev, ke, &old_keycode); if (retval) goto out; /* Make sure KEY_RESERVED did not get enabled. */ __clear_bit(KEY_RESERVED, dev->keybit); /* * Simulate keyup event if keycode is not present * in the keymap anymore */ if (test_bit(EV_KEY, dev->evbit) && !is_event_supported(old_keycode, dev->keybit, KEY_MAX) && __test_and_clear_bit(old_keycode, dev->key)) { struct input_value vals[] = { { EV_KEY, old_keycode, 0 }, input_value_sync }; input_pass_values(dev, vals, ARRAY_SIZE(vals)); } out: spin_unlock_irqrestore(&dev->event_lock, flags); return retval; }
157
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
__mptctl_ioctl
__mptctl_ioctl( struct file * file , unsigned int cmd , unsigned long arg)
['file', 'cmd', 'arg']
__mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { mpt_ioctl_header __user *uhdr = (void __user *) arg; mpt_ioctl_header khdr; int iocnum; unsigned iocnumX; int nonblock = (file->f_flags & O_NONBLOCK); int ret; MPT_ADAPTER *iocp = NULL; if (copy_from_user(&khdr, uhdr, sizeof(khdr))) { printk(KERN_ERR MYNAM "%s::mptctl_ioctl() @%d - " "Unable to copy mpt_ioctl_header data @ %p\n", __FILE__, __LINE__, uhdr); return -EFAULT; } ret = -ENXIO; /* (-6) No such device or address */ /* Verify intended MPT adapter - set iocnum and the adapter * pointer (iocp) */ iocnumX = khdr.iocnum & 0xFF; if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || (iocp == NULL)) return -ENODEV; if (!iocp->active) { printk(KERN_DEBUG MYNAM "%s::mptctl_ioctl() @%d - Controller disabled.\n", __FILE__, __LINE__); return -EFAULT; } /* Handle those commands that are just returning * information stored in the driver. * These commands should never time out and are unaffected * by TM and FW reloads. */ if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) { return mptctl_getiocinfo(arg, _IOC_SIZE(cmd)); } else if (cmd == MPTTARGETINFO) { return mptctl_gettargetinfo(arg); } else if (cmd == MPTTEST) { return mptctl_readtest(arg); } else if (cmd == MPTEVENTQUERY) { return mptctl_eventquery(arg); } else if (cmd == MPTEVENTENABLE) { return mptctl_eventenable(arg); } else if (cmd == MPTEVENTREPORT) { return mptctl_eventreport(arg); } else if (cmd == MPTFWREPLACE) { return mptctl_replace_fw(arg); } /* All of these commands require an interrupt or * are unknown/illegal. */ if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) return ret; if (cmd == MPTFWDOWNLOAD) ret = mptctl_fw_download(arg); else if (cmd == MPTCOMMAND) ret = mptctl_mpt_command(arg); else if (cmd == MPTHARDRESET) ret = mptctl_do_reset(arg); else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK)) ret = mptctl_hp_hostinfo(arg, _IOC_SIZE(cmd)); else if (cmd == HP_GETTARGETINFO) ret = mptctl_hp_targetinfo(arg); else ret = -EINVAL; mutex_unlock(&iocp->ioctl_cmds.mutex); return ret; }
394
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
compat_mpt_command
compat_mpt_command( struct file * filp , unsigned int cmd , unsigned long arg)
['filp', 'cmd', 'arg']
compat_mpt_command(struct file *filp, unsigned int cmd, unsigned long arg) { struct mpt_ioctl_command32 karg32; struct mpt_ioctl_command32 __user *uarg = (struct mpt_ioctl_command32 __user *) arg; struct mpt_ioctl_command karg; MPT_ADAPTER *iocp = NULL; int iocnum, iocnumX; int nonblock = (filp->f_flags & O_NONBLOCK); int ret; if (copy_from_user(&karg32, (char __user *)arg, sizeof(karg32))) return -EFAULT; /* Verify intended MPT adapter */ iocnumX = karg32.hdr.iocnum & 0xFF; if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || (iocp == NULL)) { printk(KERN_DEBUG MYNAM "::compat_mpt_command @%d - ioc%d not found!\n", __LINE__, iocnumX); return -ENODEV; } if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) return ret; dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "compat_mpt_command() called\n", iocp->name)); /* Copy data to karg */ karg.hdr.iocnum = karg32.hdr.iocnum; karg.hdr.port = karg32.hdr.port; karg.timeout = karg32.timeout; karg.maxReplyBytes = karg32.maxReplyBytes; karg.dataInSize = karg32.dataInSize; karg.dataOutSize = karg32.dataOutSize; karg.maxSenseBytes = karg32.maxSenseBytes; karg.dataSgeOffset = karg32.dataSgeOffset; karg.replyFrameBufPtr = (char __user *)(unsigned long)karg32.replyFrameBufPtr; karg.dataInBufPtr = (char __user *)(unsigned long)karg32.dataInBufPtr; karg.dataOutBufPtr = (char __user *)(unsigned long)karg32.dataOutBufPtr; karg.senseDataPtr = (char __user *)(unsigned long)karg32.senseDataPtr; /* Pass new structure to do_mpt_command */ ret = mptctl_do_mpt_command (karg, &uarg->MF); mutex_unlock(&iocp->ioctl_cmds.mutex); return ret; }
337
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
compat_mptfwxfer_ioctl
compat_mptfwxfer_ioctl( struct file * filp , unsigned int cmd , unsigned long arg)
['filp', 'cmd', 'arg']
compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct mpt_fw_xfer32 kfw32; struct mpt_fw_xfer kfw; MPT_ADAPTER *iocp = NULL; int iocnum, iocnumX; int nonblock = (filp->f_flags & O_NONBLOCK); int ret; if (copy_from_user(&kfw32, (char __user *)arg, sizeof(kfw32))) return -EFAULT; /* Verify intended MPT adapter */ iocnumX = kfw32.iocnum & 0xFF; if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || (iocp == NULL)) { printk(KERN_DEBUG MYNAM "::compat_mptfwxfer_ioctl @%d - ioc%d not found!\n", __LINE__, iocnumX); return -ENODEV; } if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) return ret; dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "compat_mptfwxfer_ioctl() called\n", iocp->name)); kfw.iocnum = iocnum; kfw.fwlen = kfw32.fwlen; kfw.bufp = compat_ptr(kfw32.bufp); ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); mutex_unlock(&iocp->ioctl_cmds.mutex); return ret; }
211
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_do_fw_download
mptctl_do_fw_download( int ioc , char __user * ufwbuf , size_t fwlen)
['ioc', 'ufwbuf', 'fwlen']
mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) { FWDownload_t *dlmsg; MPT_FRAME_HDR *mf; MPT_ADAPTER *iocp; FWDownloadTCSGE_t *ptsge; MptSge_t *sgl, *sgIn; char *sgOut; struct buflist *buflist; struct buflist *bl; dma_addr_t sgl_dma; int ret; int numfrags = 0; int maxfrags; int n = 0; u32 sgdir; u32 nib; int fw_bytes_copied = 0; int i; int sge_offset = 0; u16 iocstat; pFWDownloadReply_t ReplyMsg = NULL; unsigned long timeleft; if (mpt_verify_adapter(ioc, &iocp) < 0) { printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n", ioc); return -ENODEV; /* (-6) No such device or address */ } else { /* Valid device. Get a message frame and construct the FW download message. */ if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) return -EAGAIN; } dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.bufp = %p\n", iocp->name, ufwbuf)); dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", iocp->name, (int)fwlen)); dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n", iocp->name, ioc)); dlmsg = (FWDownload_t*) mf; ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; sgOut = (char *) (ptsge + 1); /* * Construct f/w download request */ dlmsg->ImageType = MPI_FW_DOWNLOAD_ITYPE_FW; dlmsg->Reserved = 0; dlmsg->ChainOffset = 0; dlmsg->Function = MPI_FUNCTION_FW_DOWNLOAD; dlmsg->Reserved1[0] = dlmsg->Reserved1[1] = dlmsg->Reserved1[2] = 0; if (iocp->facts.MsgVersion >= MPI_VERSION_01_05) dlmsg->MsgFlags = MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT; else dlmsg->MsgFlags = 0; /* Set up the Transaction SGE. */ ptsge->Reserved = 0; ptsge->ContextSize = 0; ptsge->DetailsLength = 12; ptsge->Flags = MPI_SGE_FLAGS_TRANSACTION_ELEMENT; ptsge->Reserved_0100_Checksum = 0; ptsge->ImageOffset = 0; ptsge->ImageSize = cpu_to_le32(fwlen); /* Add the SGL */ /* * Need to kmalloc area(s) for holding firmware image bytes. * But we need to do it piece meal, using a proper * scatter gather list (with 128kB MAX hunks). * * A practical limit here might be # of sg hunks that fit into * a single IOC request frame; 12 or 8 (see below), so: * For FC9xx: 12 x 128kB == 1.5 mB (max) * For C1030: 8 x 128kB == 1 mB (max) * We could support chaining, but things get ugly(ier:) * * Set the sge_offset to the start of the sgl (bytes). */ sgdir = 0x04000000; /* IOC will READ from sys mem */ sge_offset = sizeof(MPIHeader_t) + sizeof(FWDownloadTCSGE_t); if ((sgl = kbuf_alloc_2_sgl(fwlen, sgdir, sge_offset, &numfrags, &buflist, &sgl_dma, iocp)) == NULL) return -ENOMEM; /* * We should only need SGL with 2 simple_32bit entries (up to 256 kB) * for FC9xx f/w image, but calculate max number of sge hunks * we can fit into a request frame, and limit ourselves to that. * (currently no chain support) * maxfrags = (Request Size - FWdownload Size ) / Size of 32 bit SGE * Request maxfrags * 128 12 * 96 8 * 64 4 */ maxfrags = (iocp->req_sz - sizeof(MPIHeader_t) - sizeof(FWDownloadTCSGE_t)) / iocp->SGE_size; if (numfrags > maxfrags) { ret = -EMLINK; goto fwdl_out; } dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: sgl buffer = %p, sgfrags = %d\n", iocp->name, sgl, numfrags)); /* * Parse SG list, copying sgl itself, * plus f/w image hunks from user space as we go... */ ret = -EFAULT; sgIn = sgl; bl = buflist; for (i=0; i < numfrags; i++) { /* Get the SGE type: 0 - TCSGE, 3 - Chain, 1 - Simple SGE * Skip everything but Simple. If simple, copy from * user space into kernel space. * Note: we should not have anything but Simple as * Chain SGE are illegal. */ nib = (sgIn->FlagsLength & 0x30000000) >> 28; if (nib == 0 || nib == 3) { ; } else if (sgIn->Address) { iocp->add_sge(sgOut, sgIn->FlagsLength, sgIn->Address); n++; if (copy_from_user(bl->kptr, ufwbuf+fw_bytes_copied, bl->len)) { printk(MYIOC_s_ERR_FMT "%s@%d::_ioctl_fwdl - " "Unable to copy f/w buffer hunk#%d @ %p\n", iocp->name, __FILE__, __LINE__, n, ufwbuf); goto fwdl_out; } fw_bytes_copied += bl->len; } sgIn++; bl++; sgOut += iocp->SGE_size; } DBG_DUMP_FW_DOWNLOAD(iocp, (u32 *)mf, numfrags); /* * Finally, perform firmware download. */ ReplyMsg = NULL; SET_MGMT_MSG_CONTEXT(iocp->ioctl_cmds.msg_context, dlmsg->MsgContext); INITIALIZE_MGMT_STATUS(iocp->ioctl_cmds.status) mpt_put_msg_frame(mptctl_id, iocp, mf); /* Now wait for the command to complete */ retry_wait: timeleft = wait_for_completion_timeout(&iocp->ioctl_cmds.done, HZ*60); if (!(iocp->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { ret = -ETIME; printk(MYIOC_s_WARN_FMT "%s: failed\n", iocp->name, __func__); if (iocp->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { mpt_free_msg_frame(iocp, mf); goto fwdl_out; } if (!timeleft) { printk(MYIOC_s_WARN_FMT "FW download timeout, doorbell=0x%08x\n", iocp->name, mpt_GetIocState(iocp, 0)); mptctl_timeout_expired(iocp, mf); } else goto retry_wait; goto fwdl_out; } if (!(iocp->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID)) { printk(MYIOC_s_WARN_FMT "%s: failed\n", iocp->name, __func__); mpt_free_msg_frame(iocp, mf); ret = -ENODATA; goto fwdl_out; } if (sgl) kfree_sgl(sgl, sgl_dma, buflist, iocp); ReplyMsg = (pFWDownloadReply_t)iocp->ioctl_cmds.reply; iocstat = le16_to_cpu(ReplyMsg->IOCStatus) & MPI_IOCSTATUS_MASK; if (iocstat == MPI_IOCSTATUS_SUCCESS) { printk(MYIOC_s_INFO_FMT "F/W update successful!\n", iocp->name); return 0; } else if (iocstat == MPI_IOCSTATUS_INVALID_FUNCTION) { printk(MYIOC_s_WARN_FMT "Hmmm... F/W download not supported!?!\n", iocp->name); printk(MYIOC_s_WARN_FMT "(time to go bang on somebodies door)\n", iocp->name); return -EBADRQC; } else if (iocstat == MPI_IOCSTATUS_BUSY) { printk(MYIOC_s_WARN_FMT "IOC_BUSY!\n", iocp->name); printk(MYIOC_s_WARN_FMT "(try again later?)\n", iocp->name); return -EBUSY; } else { printk(MYIOC_s_WARN_FMT "ioctl_fwdl() returned [bad] status = %04xh\n", iocp->name, iocstat); printk(MYIOC_s_WARN_FMT "(bad VooDoo)\n", iocp->name); return -ENOMSG; } return 0; fwdl_out: CLEAR_MGMT_STATUS(iocp->ioctl_cmds.status); SET_MGMT_MSG_CONTEXT(iocp->ioctl_cmds.msg_context, 0); kfree_sgl(sgl, sgl_dma, buflist, iocp); return ret; }
1004
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_do_mpt_command
mptctl_do_mpt_command( struct mpt_ioctl_command karg , void __user * mfPtr)
['karg', 'mfPtr']
mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) { MPT_ADAPTER *ioc; MPT_FRAME_HDR *mf = NULL; MPIHeader_t *hdr; char *psge; struct buflist bufIn; /* data In buffer */ struct buflist bufOut; /* data Out buffer */ dma_addr_t dma_addr_in; dma_addr_t dma_addr_out; int sgSize = 0; /* Num SG elements */ int iocnum, flagsLength; int sz, rc = 0; int msgContext; u16 req_idx; ulong timeout; unsigned long timeleft; struct scsi_device *sdev; unsigned long flags; u8 function; /* bufIn and bufOut are used for user to kernel space transfers */ bufIn.kptr = bufOut.kptr = NULL; bufIn.len = bufOut.len = 0; if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } spin_lock_irqsave(&ioc->taskmgmt_lock, flags); if (ioc->ioc_reset_in_progress) { spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); printk(KERN_ERR MYNAM "%s@%d::mptctl_do_mpt_command - " "Busy with diagnostic reset\n", __FILE__, __LINE__); return -EBUSY; } spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); /* Basic sanity checks to prevent underflows or integer overflows */ if (karg.maxReplyBytes < 0 || karg.dataInSize < 0 || karg.dataOutSize < 0 || karg.dataSgeOffset < 0 || karg.maxSenseBytes < 0 || karg.dataSgeOffset > ioc->req_sz / 4) return -EINVAL; /* Verify that the final request frame will not be too large. */ sz = karg.dataSgeOffset * 4; if (karg.dataInSize > 0) sz += ioc->SGE_size; if (karg.dataOutSize > 0) sz += ioc->SGE_size; if (sz > ioc->req_sz) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Request frame too large (%d) maximum (%d)\n", ioc->name, __FILE__, __LINE__, sz, ioc->req_sz); return -EFAULT; } /* Get a free request frame and save the message context. */ if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) return -EAGAIN; hdr = (MPIHeader_t *) mf; msgContext = le32_to_cpu(hdr->MsgContext); req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); /* Copy the request frame * Reset the saved message context. * Request frame in user space */ if (copy_from_user(mf, mfPtr, karg.dataSgeOffset * 4)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Unable to read MF from mpt_ioctl_command struct @ %p\n", ioc->name, __FILE__, __LINE__, mfPtr); function = -1; rc = -EFAULT; goto done_free_mem; } hdr->MsgContext = cpu_to_le32(msgContext); function = hdr->Function; /* Verify that this request is allowed. */ dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "sending mpi function (0x%02X), req=%p\n", ioc->name, hdr->Function, mf)); switch (function) { case MPI_FUNCTION_IOC_FACTS: case MPI_FUNCTION_PORT_FACTS: karg.dataOutSize = karg.dataInSize = 0; break; case MPI_FUNCTION_CONFIG: { Config_t *config_frame; config_frame = (Config_t *)mf; dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "\ttype=0x%02x ext_type=0x%02x " "number=0x%02x action=0x%02x\n", ioc->name, config_frame->Header.PageType, config_frame->ExtPageType, config_frame->Header.PageNumber, config_frame->Action)); break; } case MPI_FUNCTION_FC_COMMON_TRANSPORT_SEND: case MPI_FUNCTION_FC_EX_LINK_SRVC_SEND: case MPI_FUNCTION_FW_UPLOAD: case MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR: case MPI_FUNCTION_FW_DOWNLOAD: case MPI_FUNCTION_FC_PRIMITIVE_SEND: case MPI_FUNCTION_TOOLBOX: case MPI_FUNCTION_SAS_IO_UNIT_CONTROL: break; case MPI_FUNCTION_SCSI_IO_REQUEST: if (ioc->sh) { SCSIIORequest_t *pScsiReq = (SCSIIORequest_t *) mf; int qtag = MPI_SCSIIO_CONTROL_UNTAGGED; int scsidir = 0; int dataSize; u32 id; id = (ioc->devices_per_bus == 0) ? 256 : ioc->devices_per_bus; if (pScsiReq->TargetID > id) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Target ID out of bounds. \n", ioc->name, __FILE__, __LINE__); rc = -ENODEV; goto done_free_mem; } if (pScsiReq->Bus >= ioc->number_of_buses) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Target Bus out of bounds. \n", ioc->name, __FILE__, __LINE__); rc = -ENODEV; goto done_free_mem; } pScsiReq->MsgFlags &= ~MPI_SCSIIO_MSGFLGS_SENSE_WIDTH; pScsiReq->MsgFlags |= mpt_msg_flags(ioc); /* verify that app has not requested * more sense data than driver * can provide, if so, reset this parameter * set the sense buffer pointer low address * update the control field to specify Q type */ if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) pScsiReq->SenseBufferLength = MPT_SENSE_BUFFER_SIZE; else pScsiReq->SenseBufferLength = karg.maxSenseBytes; pScsiReq->SenseBufferLowAddr = cpu_to_le32(ioc->sense_buf_low_dma + (req_idx * MPT_SENSE_BUFFER_ALLOC)); shost_for_each_device(sdev, ioc->sh) { struct scsi_target *starget = scsi_target(sdev); VirtTarget *vtarget = starget->hostdata; if (vtarget == NULL) continue; if ((pScsiReq->TargetID == vtarget->id) && (pScsiReq->Bus == vtarget->channel) && (vtarget->tflags & MPT_TARGET_FLAGS_Q_YES)) qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; } /* Have the IOCTL driver set the direction based * on the dataOutSize (ordering issue with Sparc). */ if (karg.dataOutSize > 0) { scsidir = MPI_SCSIIO_CONTROL_WRITE; dataSize = karg.dataOutSize; } else { scsidir = MPI_SCSIIO_CONTROL_READ; dataSize = karg.dataInSize; } pScsiReq->Control = cpu_to_le32(scsidir | qtag); pScsiReq->DataLength = cpu_to_le32(dataSize); } else { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "SCSI driver is not loaded. \n", ioc->name, __FILE__, __LINE__); rc = -EFAULT; goto done_free_mem; } break; case MPI_FUNCTION_SMP_PASSTHROUGH: /* Check mf->PassthruFlags to determine if * transfer is ImmediateMode or not. * Immediate mode returns data in the ReplyFrame. * Else, we are sending request and response data * in two SGLs at the end of the mf. */ break; case MPI_FUNCTION_SATA_PASSTHROUGH: if (!ioc->sh) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "SCSI driver is not loaded. \n", ioc->name, __FILE__, __LINE__); rc = -EFAULT; goto done_free_mem; } break; case MPI_FUNCTION_RAID_ACTION: /* Just add a SGE */ break; case MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH: if (ioc->sh) { SCSIIORequest_t *pScsiReq = (SCSIIORequest_t *) mf; int qtag = MPI_SCSIIO_CONTROL_SIMPLEQ; int scsidir = MPI_SCSIIO_CONTROL_READ; int dataSize; pScsiReq->MsgFlags &= ~MPI_SCSIIO_MSGFLGS_SENSE_WIDTH; pScsiReq->MsgFlags |= mpt_msg_flags(ioc); /* verify that app has not requested * more sense data than driver * can provide, if so, reset this parameter * set the sense buffer pointer low address * update the control field to specify Q type */ if (karg.maxSenseBytes > MPT_SENSE_BUFFER_SIZE) pScsiReq->SenseBufferLength = MPT_SENSE_BUFFER_SIZE; else pScsiReq->SenseBufferLength = karg.maxSenseBytes; pScsiReq->SenseBufferLowAddr = cpu_to_le32(ioc->sense_buf_low_dma + (req_idx * MPT_SENSE_BUFFER_ALLOC)); /* All commands to physical devices are tagged */ /* Have the IOCTL driver set the direction based * on the dataOutSize (ordering issue with Sparc). */ if (karg.dataOutSize > 0) { scsidir = MPI_SCSIIO_CONTROL_WRITE; dataSize = karg.dataOutSize; } else { scsidir = MPI_SCSIIO_CONTROL_READ; dataSize = karg.dataInSize; } pScsiReq->Control = cpu_to_le32(scsidir | qtag); pScsiReq->DataLength = cpu_to_le32(dataSize); } else { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "SCSI driver is not loaded. \n", ioc->name, __FILE__, __LINE__); rc = -EFAULT; goto done_free_mem; } break; case MPI_FUNCTION_SCSI_TASK_MGMT: { SCSITaskMgmt_t *pScsiTm; pScsiTm = (SCSITaskMgmt_t *)mf; dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "\tTaskType=0x%x MsgFlags=0x%x " "TaskMsgContext=0x%x id=%d channel=%d\n", ioc->name, pScsiTm->TaskType, le32_to_cpu (pScsiTm->TaskMsgContext), pScsiTm->MsgFlags, pScsiTm->TargetID, pScsiTm->Bus)); break; } case MPI_FUNCTION_IOC_INIT: { IOCInit_t *pInit = (IOCInit_t *) mf; u32 high_addr, sense_high; /* Verify that all entries in the IOC INIT match * existing setup (and in LE format). */ if (sizeof(dma_addr_t) == sizeof(u64)) { high_addr = cpu_to_le32((u32)((u64)ioc->req_frames_dma >> 32)); sense_high= cpu_to_le32((u32)((u64)ioc->sense_buf_pool_dma >> 32)); } else { high_addr = 0; sense_high= 0; } if ((pInit->Flags != 0) || (pInit->MaxDevices != ioc->facts.MaxDevices) || (pInit->MaxBuses != ioc->facts.MaxBuses) || (pInit->ReplyFrameSize != cpu_to_le16(ioc->reply_sz)) || (pInit->HostMfaHighAddr != high_addr) || (pInit->SenseBufferHighAddr != sense_high)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "IOC_INIT issued with 1 or more incorrect parameters. Rejected.\n", ioc->name, __FILE__, __LINE__); rc = -EFAULT; goto done_free_mem; } } break; default: /* * MPI_FUNCTION_PORT_ENABLE * MPI_FUNCTION_TARGET_CMD_BUFFER_POST * MPI_FUNCTION_TARGET_ASSIST * MPI_FUNCTION_TARGET_STATUS_SEND * MPI_FUNCTION_TARGET_MODE_ABORT * MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET * MPI_FUNCTION_IO_UNIT_RESET * MPI_FUNCTION_HANDSHAKE * MPI_FUNCTION_REPLY_FRAME_REMOVAL * MPI_FUNCTION_EVENT_NOTIFICATION * (driver handles event notification) * MPI_FUNCTION_EVENT_ACK */ /* What to do with these??? CHECK ME!!! MPI_FUNCTION_FC_LINK_SRVC_BUF_POST MPI_FUNCTION_FC_LINK_SRVC_RSP MPI_FUNCTION_FC_ABORT MPI_FUNCTION_LAN_SEND MPI_FUNCTION_LAN_RECEIVE MPI_FUNCTION_LAN_RESET */ printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Illegal request (function 0x%x) \n", ioc->name, __FILE__, __LINE__, hdr->Function); rc = -EFAULT; goto done_free_mem; } /* Add the SGL ( at most one data in SGE and one data out SGE ) * In the case of two SGE's - the data out (write) will always * preceede the data in (read) SGE. psgList is used to free the * allocated memory. */ psge = (char *) (((int *) mf) + karg.dataSgeOffset); flagsLength = 0; if (karg.dataOutSize > 0) sgSize ++; if (karg.dataInSize > 0) sgSize ++; if (sgSize > 0) { /* Set up the dataOut memory allocation */ if (karg.dataOutSize > 0) { if (karg.dataInSize > 0) { flagsLength = ( MPI_SGE_FLAGS_SIMPLE_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER | MPI_SGE_FLAGS_DIRECTION) << MPI_SGE_FLAGS_SHIFT; } else { flagsLength = MPT_SGE_FLAGS_SSIMPLE_WRITE; } flagsLength |= karg.dataOutSize; bufOut.len = karg.dataOutSize; bufOut.kptr = pci_alloc_consistent( ioc->pcidev, bufOut.len, &dma_addr_out); if (bufOut.kptr == NULL) { rc = -ENOMEM; goto done_free_mem; } else { /* Set up this SGE. * Copy to MF and to sglbuf */ ioc->add_sge(psge, flagsLength, dma_addr_out); psge += ioc->SGE_size; /* Copy user data to kernel space. */ if (copy_from_user(bufOut.kptr, karg.dataOutBufPtr, bufOut.len)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - Unable " "to read user data " "struct @ %p\n", ioc->name, __FILE__, __LINE__,karg.dataOutBufPtr); rc = -EFAULT; goto done_free_mem; } } } if (karg.dataInSize > 0) { flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; flagsLength |= karg.dataInSize; bufIn.len = karg.dataInSize; bufIn.kptr = pci_alloc_consistent(ioc->pcidev, bufIn.len, &dma_addr_in); if (bufIn.kptr == NULL) { rc = -ENOMEM; goto done_free_mem; } else { /* Set up this SGE * Copy to MF and to sglbuf */ ioc->add_sge(psge, flagsLength, dma_addr_in); } } } else { /* Add a NULL SGE */ ioc->add_sge(psge, flagsLength, (dma_addr_t) -1); } SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, hdr->MsgContext); INITIALIZE_MGMT_STATUS(ioc->ioctl_cmds.status) if (hdr->Function == MPI_FUNCTION_SCSI_TASK_MGMT) { mutex_lock(&ioc->taskmgmt_cmds.mutex); if (mpt_set_taskmgmt_in_progress_flag(ioc) != 0) { mutex_unlock(&ioc->taskmgmt_cmds.mutex); goto done_free_mem; } DBG_DUMP_TM_REQUEST_FRAME(ioc, (u32 *)mf); if ((ioc->facts.IOCCapabilities & MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q) && (ioc->facts.MsgVersion >= MPI_VERSION_01_05)) mpt_put_msg_frame_hi_pri(mptctl_id, ioc, mf); else { rc =mpt_send_handshake_request(mptctl_id, ioc, sizeof(SCSITaskMgmt_t), (u32*)mf, CAN_SLEEP); if (rc != 0) { dfailprintk(ioc, printk(MYIOC_s_ERR_FMT "send_handshake FAILED! (ioc %p, mf %p)\n", ioc->name, ioc, mf)); mpt_clear_taskmgmt_in_progress_flag(ioc); rc = -ENODATA; mutex_unlock(&ioc->taskmgmt_cmds.mutex); goto done_free_mem; } } } else mpt_put_msg_frame(mptctl_id, ioc, mf); /* Now wait for the command to complete */ timeout = (karg.timeout > 0) ? karg.timeout : MPT_IOCTL_DEFAULT_TIMEOUT; retry_wait: timeleft = wait_for_completion_timeout(&ioc->ioctl_cmds.done, HZ*timeout); if (!(ioc->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { rc = -ETIME; dfailprintk(ioc, printk(MYIOC_s_ERR_FMT "%s: TIMED OUT!\n", ioc->name, __func__)); if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { if (function == MPI_FUNCTION_SCSI_TASK_MGMT) mutex_unlock(&ioc->taskmgmt_cmds.mutex); goto done_free_mem; } if (!timeleft) { printk(MYIOC_s_WARN_FMT "mpt cmd timeout, doorbell=0x%08x" " function=0x%x\n", ioc->name, mpt_GetIocState(ioc, 0), function); if (function == MPI_FUNCTION_SCSI_TASK_MGMT) mutex_unlock(&ioc->taskmgmt_cmds.mutex); mptctl_timeout_expired(ioc, mf); mf = NULL; } else goto retry_wait; goto done_free_mem; } if (function == MPI_FUNCTION_SCSI_TASK_MGMT) mutex_unlock(&ioc->taskmgmt_cmds.mutex); mf = NULL; /* If a valid reply frame, copy to the user. * Offset 2: reply length in U32's */ if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID) { if (karg.maxReplyBytes < ioc->reply_sz) { sz = min(karg.maxReplyBytes, 4*ioc->ioctl_cmds.reply[2]); } else { sz = min(ioc->reply_sz, 4*ioc->ioctl_cmds.reply[2]); } if (sz > 0) { if (copy_to_user(karg.replyFrameBufPtr, ioc->ioctl_cmds.reply, sz)){ printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Unable to write out reply frame %p\n", ioc->name, __FILE__, __LINE__, karg.replyFrameBufPtr); rc = -ENODATA; goto done_free_mem; } } } /* If valid sense data, copy to user. */ if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_SENSE_VALID) { sz = min(karg.maxSenseBytes, MPT_SENSE_BUFFER_SIZE); if (sz > 0) { if (copy_to_user(karg.senseDataPtr, ioc->ioctl_cmds.sense, sz)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Unable to write sense data to user %p\n", ioc->name, __FILE__, __LINE__, karg.senseDataPtr); rc = -ENODATA; goto done_free_mem; } } } /* If the overall status is _GOOD and data in, copy data * to user. */ if ((ioc->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD) && (karg.dataInSize > 0) && (bufIn.kptr)) { if (copy_to_user(karg.dataInBufPtr, bufIn.kptr, karg.dataInSize)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - " "Unable to write data to user %p\n", ioc->name, __FILE__, __LINE__, karg.dataInBufPtr); rc = -ENODATA; } } done_free_mem: CLEAR_MGMT_STATUS(ioc->ioctl_cmds.status) SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, 0); /* Free the allocated memory. */ if (bufOut.kptr != NULL) { pci_free_consistent(ioc->pcidev, bufOut.len, (void *) bufOut.kptr, dma_addr_out); } if (bufIn.kptr != NULL) { pci_free_consistent(ioc->pcidev, bufIn.len, (void *) bufIn.kptr, dma_addr_in); } /* mf is null if command issued successfully * otherwise, failure occurred after mf acquired. */ if (mf) mpt_free_msg_frame(ioc, mf); return rc; }
2422
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_do_reset
mptctl_do_reset( unsigned long arg)
['arg']
static int mptctl_do_reset(unsigned long arg) { struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg; struct mpt_ioctl_diag_reset krinfo; MPT_ADAPTER *iocp; if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - " "Unable to copy mpt_ioctl_diag_reset struct @ %p\n", __FILE__, __LINE__, urinfo); return -EFAULT; } if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n", __FILE__, __LINE__, krinfo.hdr.iocnum); return -ENODEV; /* (-6) No such device or address */ } dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", iocp->name)); if (mpt_HardResetHandler(iocp, CAN_SLEEP) != 0) { printk (MYIOC_s_ERR_FMT "%s@%d::mptctl_do_reset - reset failed.\n", iocp->name, __FILE__, __LINE__); return -1; } return 0; }
153
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_eventenable
mptctl_eventenable( unsigned long arg)
['arg']
mptctl_eventenable (unsigned long arg) { struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg; struct mpt_ioctl_eventenable karg; MPT_ADAPTER *ioc; int iocnum; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - " "Unable to read in mpt_ioctl_eventenable struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n", ioc->name)); if (ioc->events == NULL) { /* Have not yet allocated memory - do so now. */ int sz = MPTCTL_EVENT_LOG_SIZE * sizeof(MPT_IOCTL_EVENTS); ioc->events = kzalloc(sz, GFP_KERNEL); if (!ioc->events) { printk(MYIOC_s_ERR_FMT ": ERROR - Insufficient memory to add adapter!\n", ioc->name); return -ENOMEM; } ioc->alloc_total += sz; ioc->eventContext = 0; } /* Update the IOC event logging flag. */ ioc->eventTypes = karg.eventTypes; return 0; }
207
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_eventquery
mptctl_eventquery( unsigned long arg)
['arg']
mptctl_eventquery (unsigned long arg) { struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg; struct mpt_ioctl_eventquery karg; MPT_ADAPTER *ioc; int iocnum; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - " "Unable to read in mpt_ioctl_eventquery struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n", ioc->name)); karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; karg.eventTypes = ioc->eventTypes; /* Copy the data from kernel memory to user memory */ if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_eventquery - " "Unable to write out mpt_ioctl_eventquery struct @ %p\n", ioc->name, __FILE__, __LINE__, uarg); return -EFAULT; } return 0; }
191
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_eventreport
mptctl_eventreport( unsigned long arg)
['arg']
mptctl_eventreport (unsigned long arg) { struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg; struct mpt_ioctl_eventreport karg; MPT_ADAPTER *ioc; int iocnum; int numBytes, maxEvents, max; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_eventreport - " "Unable to read in mpt_ioctl_eventreport struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n", ioc->name)); numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); maxEvents = numBytes/sizeof(MPT_IOCTL_EVENTS); max = MPTCTL_EVENT_LOG_SIZE < maxEvents ? MPTCTL_EVENT_LOG_SIZE : maxEvents; /* If fewer than 1 event is requested, there must have * been some type of error. */ if ((max < 1) || !ioc->events) return -ENODATA; /* reset this flag so SIGIO can restart */ ioc->aen_event_read_flag=0; /* Copy the data from kernel memory to user memory */ numBytes = max * sizeof(MPT_IOCTL_EVENTS); if (copy_to_user(uarg->eventData, ioc->events, numBytes)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_eventreport - " "Unable to write out mpt_ioctl_eventreport struct @ %p\n", ioc->name, __FILE__, __LINE__, ioc->events); return -EFAULT; } return 0; }
244
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_fw_download
mptctl_fw_download( unsigned long arg)
['arg']
mptctl_fw_download(unsigned long arg) { struct mpt_fw_xfer __user *ufwdl = (void __user *) arg; struct mpt_fw_xfer kfwdl; if (copy_from_user(&kfwdl, ufwdl, sizeof(struct mpt_fw_xfer))) { printk(KERN_ERR MYNAM "%s@%d::_ioctl_fwdl - " "Unable to copy mpt_fw_xfer struct @ %p\n", __FILE__, __LINE__, ufwdl); return -EFAULT; } return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); }
77
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_getiocinfo
mptctl_getiocinfo( unsigned long arg , unsigned int data_size)
['arg', 'data_size']
mptctl_getiocinfo (unsigned long arg, unsigned int data_size) { struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg; struct mpt_ioctl_iocinfo *karg; MPT_ADAPTER *ioc; struct pci_dev *pdev; int iocnum; unsigned int port; int cim_rev; struct scsi_device *sdev; VirtDevice *vdevice; /* Add of PCI INFO results in unaligned access for * IA64 and Sparc. Reset long to int. Return no PCI * data for obsolete format. */ if (data_size == sizeof(struct mpt_ioctl_iocinfo_rev0)) cim_rev = 0; else if (data_size == sizeof(struct mpt_ioctl_iocinfo_rev1)) cim_rev = 1; else if (data_size == sizeof(struct mpt_ioctl_iocinfo)) cim_rev = 2; else if (data_size == (sizeof(struct mpt_ioctl_iocinfo_rev0)+12)) cim_rev = 0; /* obsolete */ else return -EFAULT; karg = memdup_user(uarg, data_size); if (IS_ERR(karg)) { printk(KERN_ERR MYNAM "%s@%d::mpt_ioctl_iocinfo() - memdup_user returned error [%ld]\n", __FILE__, __LINE__, PTR_ERR(karg)); return PTR_ERR(karg); } if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); kfree(karg); return -ENODEV; } /* Verify the data transfer size is correct. */ if (karg->hdr.maxDataSize != data_size) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - " "Structure size mismatch. Command not completed.\n", ioc->name, __FILE__, __LINE__); kfree(karg); return -EFAULT; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_getiocinfo called.\n", ioc->name)); /* Fill in the data and return the structure to the calling * program */ if (ioc->bus_type == SAS) karg->adapterType = MPT_IOCTL_INTERFACE_SAS; else if (ioc->bus_type == FC) karg->adapterType = MPT_IOCTL_INTERFACE_FC; else karg->adapterType = MPT_IOCTL_INTERFACE_SCSI; if (karg->hdr.port > 1) { kfree(karg); return -EINVAL; } port = karg->hdr.port; karg->port = port; pdev = (struct pci_dev *) ioc->pcidev; karg->pciId = pdev->device; karg->hwRev = pdev->revision; karg->subSystemDevice = pdev->subsystem_device; karg->subSystemVendor = pdev->subsystem_vendor; if (cim_rev == 1) { /* Get the PCI bus, device, and function numbers for the IOC */ karg->pciInfo.u.bits.busNumber = pdev->bus->number; karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); } else if (cim_rev == 2) { /* Get the PCI bus, device, function and segment ID numbers for the IOC */ karg->pciInfo.u.bits.busNumber = pdev->bus->number; karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn ); karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn ); karg->pciInfo.segmentID = pci_domain_nr(pdev->bus); } /* Get number of devices */ karg->numDevices = 0; if (ioc->sh) { shost_for_each_device(sdev, ioc->sh) { vdevice = sdev->hostdata; if (vdevice == NULL || vdevice->vtarget == NULL) continue; if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) continue; karg->numDevices++; } } /* Set the BIOS and FW Version */ karg->FWVersion = ioc->facts.FWVersion.Word; karg->BIOSVersion = ioc->biosVersion; /* Set the Version Strings. */ strncpy (karg->driverVersion, MPT_LINUX_PACKAGE_NAME, MPT_IOCTL_VERSION_LENGTH); karg->driverVersion[MPT_IOCTL_VERSION_LENGTH-1]='\0'; karg->busChangeEvent = 0; karg->hostId = ioc->pfacts[port].PortSCSIID; karg->rsvd[0] = karg->rsvd[1] = 0; /* Copy the data from kernel memory to user memory */ if (copy_to_user((char __user *)arg, karg, data_size)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - " "Unable to write out mpt_ioctl_iocinfo struct @ %p\n", ioc->name, __FILE__, __LINE__, uarg); kfree(karg); return -EFAULT; } kfree(karg); return 0; }
703
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_gettargetinfo
mptctl_gettargetinfo( unsigned long arg)
['arg']
mptctl_gettargetinfo (unsigned long arg) { struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg; struct mpt_ioctl_targetinfo karg; MPT_ADAPTER *ioc; VirtDevice *vdevice; char *pmem; int *pdata; int iocnum; int numDevices = 0; int lun; int maxWordsLeft; int numBytes; u8 port; struct scsi_device *sdev; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_gettargetinfo - " "Unable to read in mpt_ioctl_targetinfo struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n", ioc->name)); /* Get the port number and set the maximum number of bytes * in the returned structure. * Ignore the port setting. */ numBytes = karg.hdr.maxDataSize - sizeof(mpt_ioctl_header); maxWordsLeft = numBytes/sizeof(int); port = karg.hdr.port; if (maxWordsLeft <= 0) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo() - no memory available!\n", ioc->name, __FILE__, __LINE__); return -ENOMEM; } /* Fill in the data and return the structure to the calling * program */ /* struct mpt_ioctl_targetinfo does not contain sufficient space * for the target structures so when the IOCTL is called, there is * not sufficient stack space for the structure. Allocate memory, * populate the memory, copy back to the user, then free memory. * targetInfo format: * bits 31-24: reserved * 23-16: LUN * 15- 8: Bus Number * 7- 0: Target ID */ pmem = kzalloc(numBytes, GFP_KERNEL); if (!pmem) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo() - no memory available!\n", ioc->name, __FILE__, __LINE__); return -ENOMEM; } pdata = (int *) pmem; /* Get number of devices */ if (ioc->sh){ shost_for_each_device(sdev, ioc->sh) { if (!maxWordsLeft) continue; vdevice = sdev->hostdata; if (vdevice == NULL || vdevice->vtarget == NULL) continue; if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) continue; lun = (vdevice->vtarget->raidVolume) ? 0x80 : vdevice->lun; *pdata = (((u8)lun << 16) + (vdevice->vtarget->channel << 8) + (vdevice->vtarget->id )); pdata++; numDevices++; --maxWordsLeft; } } karg.numDevices = numDevices; /* Copy part of the data from kernel memory to user memory */ if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_targetinfo))) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo - " "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", ioc->name, __FILE__, __LINE__, uarg); kfree(pmem); return -EFAULT; } /* Copy the remaining data from kernel memory to user memory */ if (copy_to_user(uarg->targetInfo, pmem, numBytes)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_gettargetinfo - " "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", ioc->name, __FILE__, __LINE__, pdata); kfree(pmem); return -EFAULT; } kfree(pmem); return 0; }
482
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_hp_hostinfo
mptctl_hp_hostinfo( unsigned long arg , unsigned int data_size)
['arg', 'data_size']
mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) { hp_host_info_t __user *uarg = (void __user *) arg; MPT_ADAPTER *ioc; struct pci_dev *pdev; char *pbuf=NULL; dma_addr_t buf_dma; hp_host_info_t karg; CONFIGPARMS cfg; ConfigPageHeader_t hdr; int iocnum; int rc, cim_rev; ToolboxIstwiReadWriteRequest_t *IstwiRWRequest; MPT_FRAME_HDR *mf = NULL; unsigned long timeleft; int retval; u32 msgcontext; /* Reset long to int. Should affect IA64 and SPARC only */ if (data_size == sizeof(hp_host_info_t)) cim_rev = 1; else if (data_size == sizeof(hp_host_info_rev0_t)) cim_rev = 0; /* obsolete */ else return -EFAULT; if (copy_from_user(&karg, uarg, sizeof(hp_host_info_t))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_hp_host_info - " "Unable to read in hp_host_info struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n", ioc->name)); /* Fill in the data and return the structure to the calling * program */ pdev = (struct pci_dev *) ioc->pcidev; karg.vendor = pdev->vendor; karg.device = pdev->device; karg.subsystem_id = pdev->subsystem_device; karg.subsystem_vendor = pdev->subsystem_vendor; karg.devfn = pdev->devfn; karg.bus = pdev->bus->number; /* Save the SCSI host no. if * SCSI driver loaded */ if (ioc->sh != NULL) karg.host_no = ioc->sh->host_no; else karg.host_no = -1; /* Reformat the fw_version into a string */ snprintf(karg.fw_version, sizeof(karg.fw_version), "%.2hhu.%.2hhu.%.2hhu.%.2hhu", ioc->facts.FWVersion.Struct.Major, ioc->facts.FWVersion.Struct.Minor, ioc->facts.FWVersion.Struct.Unit, ioc->facts.FWVersion.Struct.Dev); /* Issue a config request to get the device serial number */ hdr.PageVersion = 0; hdr.PageLength = 0; hdr.PageNumber = 0; hdr.PageType = MPI_CONFIG_PAGETYPE_MANUFACTURING; cfg.cfghdr.hdr = &hdr; cfg.physAddr = -1; cfg.pageAddr = 0; cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; cfg.dir = 0; /* read */ cfg.timeout = 10; strncpy(karg.serial_number, " ", 24); if (mpt_config(ioc, &cfg) == 0) { if (cfg.cfghdr.hdr->PageLength > 0) { /* Issue the second config page request */ cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; pbuf = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4, &buf_dma); if (pbuf) { cfg.physAddr = buf_dma; if (mpt_config(ioc, &cfg) == 0) { ManufacturingPage0_t *pdata = (ManufacturingPage0_t *) pbuf; if (strlen(pdata->BoardTracerNumber) > 1) { strlcpy(karg.serial_number, pdata->BoardTracerNumber, 24); } } pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, pbuf, buf_dma); pbuf = NULL; } } } rc = mpt_GetIocState(ioc, 1); switch (rc) { case MPI_IOC_STATE_OPERATIONAL: karg.ioc_status = HP_STATUS_OK; break; case MPI_IOC_STATE_FAULT: karg.ioc_status = HP_STATUS_FAILED; break; case MPI_IOC_STATE_RESET: case MPI_IOC_STATE_READY: default: karg.ioc_status = HP_STATUS_OTHER; break; } karg.base_io_addr = pci_resource_start(pdev, 0); if ((ioc->bus_type == SAS) || (ioc->bus_type == FC)) karg.bus_phys_width = HP_BUS_WIDTH_UNK; else karg.bus_phys_width = HP_BUS_WIDTH_16; karg.hard_resets = 0; karg.soft_resets = 0; karg.timeouts = 0; if (ioc->sh != NULL) { MPT_SCSI_HOST *hd = shost_priv(ioc->sh); if (hd && (cim_rev == 1)) { karg.hard_resets = ioc->hard_resets; karg.soft_resets = ioc->soft_resets; karg.timeouts = ioc->timeouts; } } /* * Gather ISTWI(Industry Standard Two Wire Interface) Data */ if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) { dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, no msg frames!!\n", ioc->name, __func__)); goto out; } IstwiRWRequest = (ToolboxIstwiReadWriteRequest_t *)mf; msgcontext = IstwiRWRequest->MsgContext; memset(IstwiRWRequest,0,sizeof(ToolboxIstwiReadWriteRequest_t)); IstwiRWRequest->MsgContext = msgcontext; IstwiRWRequest->Function = MPI_FUNCTION_TOOLBOX; IstwiRWRequest->Tool = MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL; IstwiRWRequest->Flags = MPI_TB_ISTWI_FLAGS_READ; IstwiRWRequest->NumAddressBytes = 0x01; IstwiRWRequest->DataLength = cpu_to_le16(0x04); if (pdev->devfn & 1) IstwiRWRequest->DeviceAddr = 0xB2; else IstwiRWRequest->DeviceAddr = 0xB0; pbuf = pci_alloc_consistent(ioc->pcidev, 4, &buf_dma); if (!pbuf) goto out; ioc->add_sge((char *)&IstwiRWRequest->SGL, (MPT_SGE_FLAGS_SSIMPLE_READ|4), buf_dma); retval = 0; SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, IstwiRWRequest->MsgContext); INITIALIZE_MGMT_STATUS(ioc->ioctl_cmds.status) mpt_put_msg_frame(mptctl_id, ioc, mf); retry_wait: timeleft = wait_for_completion_timeout(&ioc->ioctl_cmds.done, HZ*MPT_IOCTL_DEFAULT_TIMEOUT); if (!(ioc->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { retval = -ETIME; printk(MYIOC_s_WARN_FMT "%s: failed\n", ioc->name, __func__); if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { mpt_free_msg_frame(ioc, mf); goto out; } if (!timeleft) { printk(MYIOC_s_WARN_FMT "HOST INFO command timeout, doorbell=0x%08x\n", ioc->name, mpt_GetIocState(ioc, 0)); mptctl_timeout_expired(ioc, mf); } else goto retry_wait; goto out; } /* *ISTWI Data Definition * pbuf[0] = FW_VERSION = 0x4 * pbuf[1] = Bay Count = 6 or 4 or 2, depending on * the config, you should be seeing one out of these three values * pbuf[2] = Drive Installed Map = bit pattern depend on which * bays have drives in them * pbuf[3] = Checksum (0x100 = (byte0 + byte2 + byte3) */ if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID) karg.rsvd = *(u32 *)pbuf; out: CLEAR_MGMT_STATUS(ioc->ioctl_cmds.status) SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, 0); if (pbuf) pci_free_consistent(ioc->pcidev, 4, pbuf, buf_dma); /* Copy the data from kernel memory to user memory */ if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_hpgethostinfo - " "Unable to write out hp_host_info @ %p\n", ioc->name, __FILE__, __LINE__, uarg); return -EFAULT; } return 0; }
1147
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_hp_targetinfo
mptctl_hp_targetinfo( unsigned long arg)
['arg']
mptctl_hp_targetinfo(unsigned long arg) { hp_target_info_t __user *uarg = (void __user *) arg; SCSIDevicePage0_t *pg0_alloc; SCSIDevicePage3_t *pg3_alloc; MPT_ADAPTER *ioc; MPT_SCSI_HOST *hd = NULL; hp_target_info_t karg; int iocnum; int data_sz; dma_addr_t page_dma; CONFIGPARMS cfg; ConfigPageHeader_t hdr; int tmp, np, rc = 0; if (copy_from_user(&karg, uarg, sizeof(hp_target_info_t))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_hp_targetinfo - " "Unable to read in hp_host_targetinfo struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } if (karg.hdr.id >= MPT_MAX_FC_DEVICES) return -EINVAL; dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n", ioc->name)); /* There is nothing to do for FCP parts. */ if ((ioc->bus_type == SAS) || (ioc->bus_type == FC)) return 0; if ((ioc->spi_data.sdp0length == 0) || (ioc->sh == NULL)) return 0; if (ioc->sh->host_no != karg.hdr.host) return -ENODEV; /* Get the data transfer speeds */ data_sz = ioc->spi_data.sdp0length * 4; pg0_alloc = (SCSIDevicePage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma); if (pg0_alloc) { hdr.PageVersion = ioc->spi_data.sdp0version; hdr.PageLength = data_sz; hdr.PageNumber = 0; hdr.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; cfg.cfghdr.hdr = &hdr; cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; cfg.dir = 0; cfg.timeout = 0; cfg.physAddr = page_dma; cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; if ((rc = mpt_config(ioc, &cfg)) == 0) { np = le32_to_cpu(pg0_alloc->NegotiatedParameters); karg.negotiated_width = np & MPI_SCSIDEVPAGE0_NP_WIDE ? HP_BUS_WIDTH_16 : HP_BUS_WIDTH_8; if (np & MPI_SCSIDEVPAGE0_NP_NEG_SYNC_OFFSET_MASK) { tmp = (np & MPI_SCSIDEVPAGE0_NP_NEG_SYNC_PERIOD_MASK) >> 8; if (tmp < 0x09) karg.negotiated_speed = HP_DEV_SPEED_ULTRA320; else if (tmp <= 0x09) karg.negotiated_speed = HP_DEV_SPEED_ULTRA160; else if (tmp <= 0x0A) karg.negotiated_speed = HP_DEV_SPEED_ULTRA2; else if (tmp <= 0x0C) karg.negotiated_speed = HP_DEV_SPEED_ULTRA; else if (tmp <= 0x25) karg.negotiated_speed = HP_DEV_SPEED_FAST; else karg.negotiated_speed = HP_DEV_SPEED_ASYNC; } else karg.negotiated_speed = HP_DEV_SPEED_ASYNC; } pci_free_consistent(ioc->pcidev, data_sz, (u8 *) pg0_alloc, page_dma); } /* Set defaults */ karg.message_rejects = -1; karg.phase_errors = -1; karg.parity_errors = -1; karg.select_timeouts = -1; /* Get the target error parameters */ hdr.PageVersion = 0; hdr.PageLength = 0; hdr.PageNumber = 3; hdr.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; cfg.cfghdr.hdr = &hdr; cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; cfg.dir = 0; cfg.timeout = 0; cfg.physAddr = -1; if ((mpt_config(ioc, &cfg) == 0) && (cfg.cfghdr.hdr->PageLength > 0)) { /* Issue the second config page request */ cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; data_sz = (int) cfg.cfghdr.hdr->PageLength * 4; pg3_alloc = (SCSIDevicePage3_t *) pci_alloc_consistent( ioc->pcidev, data_sz, &page_dma); if (pg3_alloc) { cfg.physAddr = page_dma; cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id; if ((rc = mpt_config(ioc, &cfg)) == 0) { karg.message_rejects = (u32) le16_to_cpu(pg3_alloc->MsgRejectCount); karg.phase_errors = (u32) le16_to_cpu(pg3_alloc->PhaseErrorCount); karg.parity_errors = (u32) le16_to_cpu(pg3_alloc->ParityErrorCount); } pci_free_consistent(ioc->pcidev, data_sz, (u8 *) pg3_alloc, page_dma); } } hd = shost_priv(ioc->sh); if (hd != NULL) karg.select_timeouts = hd->sel_timeout[karg.hdr.id]; /* Copy the data from kernel memory to user memory */ if (copy_to_user((char __user *)arg, &karg, sizeof(hp_target_info_t))) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_hp_target_info - " "Unable to write out mpt_ioctl_targetinfo struct @ %p\n", ioc->name, __FILE__, __LINE__, uarg); return -EFAULT; } return 0; }
846
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_mpt_command
mptctl_mpt_command( unsigned long arg)
['arg']
mptctl_mpt_command (unsigned long arg) { struct mpt_ioctl_command __user *uarg = (void __user *) arg; struct mpt_ioctl_command karg; MPT_ADAPTER *ioc; int iocnum; int rc; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_mpt_command - " "Unable to read in mpt_ioctl_command struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } rc = mptctl_do_mpt_command (karg, &uarg->MF); return rc; }
133
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_readtest
mptctl_readtest( unsigned long arg)
['arg']
mptctl_readtest (unsigned long arg) { struct mpt_ioctl_test __user *uarg = (void __user *) arg; struct mpt_ioctl_test karg; MPT_ADAPTER *ioc; int iocnum; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - " "Unable to read in mpt_ioctl_test struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n", ioc->name)); /* Fill in the data and return the structure to the calling * program */ #ifdef MFCNT karg.chip_type = ioc->mfcnt; #else karg.chip_type = ioc->pcidev->device; #endif strncpy (karg.name, ioc->name, MPT_MAX_NAME); karg.name[MPT_MAX_NAME-1]='\0'; strncpy (karg.product, ioc->prod_name, MPT_PRODUCT_LENGTH); karg.product[MPT_PRODUCT_LENGTH-1]='\0'; /* Copy the data from kernel memory to user memory */ if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_test))) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_readtest - " "Unable to write out mpt_ioctl_test struct @ %p\n", ioc->name, __FILE__, __LINE__, uarg); return -EFAULT; } return 0; }
243
True
1
CVE-2020-12652
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:C
LOCAL
MEDIUM
NONE
NONE
NONE
COMPLETE
4.7
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
LOCAL
HIGH
HIGH
NONE
UNCHANGED
NONE
NONE
HIGH
4.1
MEDIUM
0.5
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://github.com/torvalds/linux/commit/28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=28d76df18f0ad5bcf5fa48510b225f0ed262a99b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.14', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-362'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.4.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The __mptctl_ioctl function in drivers/message/fusion/mptctl.c in the Linux kernel before 5.4.14 allows local users to hold an incorrect lock during the ioctl operation and trigger a race condition, i.e., a "double fetch" vulnerability, aka CID-28d76df18f0a. NOTE: the vendor states "The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power."'}]
2020-06-13T09:15Z
2020-05-05T05:15Z
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider. 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. A race condition violates these properties, which are closely related: 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. 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. 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). 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.
https://cwe.mitre.org/data/definitions/362.html
0
Dan Carpenter
2020-01-14 15:34:14+03:00
scsi: mptfusion: Fix double fetch bug in ioctl Tom Hatskevich reported that we look up "iocp" then, in the called functions we do a second copy_from_user() and look it up again. The problem that could cause is: drivers/message/fusion/mptctl.c 674 /* All of these commands require an interrupt or 675 * are unknown/illegal. 676 */ 677 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) ^^^^ We take this lock. 678 return ret; 679 680 if (cmd == MPTFWDOWNLOAD) 681 ret = mptctl_fw_download(arg); ^^^ Then the user memory changes and we look up "iocp" again but a different one so now we are holding the incorrect lock and have a race condition. 682 else if (cmd == MPTCOMMAND) 683 ret = mptctl_mpt_command(arg); The security impact of this bug is not as bad as it could have been because these operations are all privileged and root already has enormous destructive power. But it's still worth fixing. This patch passes the "iocp" pointer to the functions to avoid the second lookup. That deletes 100 lines of code from the driver so it's a nice clean up as well. Link: https://lore.kernel.org/r/20200114123414.GA7957@kadam Reported-by: Tom Hatskevich <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
28d76df18f0ad5bcf5fa48510b225f0ed262a99b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mptctl_replace_fw
mptctl_replace_fw( unsigned long arg)
['arg']
mptctl_replace_fw (unsigned long arg) { struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg; struct mpt_ioctl_replace_fw karg; MPT_ADAPTER *ioc; int iocnum; int newFwSize; if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { printk(KERN_ERR MYNAM "%s@%d::mptctl_replace_fw - " "Unable to read in mpt_ioctl_replace_fw struct @ %p\n", __FILE__, __LINE__, uarg); return -EFAULT; } if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || (ioc == NULL)) { printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", __FILE__, __LINE__, iocnum); return -ENODEV; } dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n", ioc->name)); /* If caching FW, Free the old FW image */ if (ioc->cached_fw == NULL) return 0; mpt_free_fw_memory(ioc); /* Allocate memory for the new FW image */ newFwSize = ALIGN(karg.newImageSize, 4); mpt_alloc_fw_memory(ioc, newFwSize); if (ioc->cached_fw == NULL) return -ENOMEM; /* Copy the data from user memory to kernel space */ if (copy_from_user(ioc->cached_fw, uarg->newImage, newFwSize)) { printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_replace_fw - " "Unable to read in mpt_ioctl_replace_fw image " "@ %p\n", ioc->name, __FILE__, __LINE__, uarg); mpt_free_fw_memory(ioc); return -EFAULT; } /* Update IOCFactsReply */ ioc->facts.FWImageSize = newFwSize; return 0; }
234
True
1
CVE-2020-8428
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:P
LOCAL
LOW
NONE
PARTIAL
NONE
PARTIAL
3.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
NONE
HIGH
7.1
HIGH
1.8
5.2
False
[{'url': 'https://github.com/torvalds/linux/commit/d0cb50185ae942b03c4327be322055d622dc79f6', 'name': 'https://github.com/torvalds/linux/commit/d0cb50185ae942b03c4327be322055d622dc79f6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2020/01/28/2', 'name': 'https://www.openwall.com/lists/oss-security/2020/01/28/2', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d0cb50185ae942b03c4327be322055d622dc79f6', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d0cb50185ae942b03c4327be322055d622dc79f6', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Vendor Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/01/28/4', 'name': '[oss-security] 20200129 Re: Linux kernel: user-triggerable read-after-free crash or 1-bit infoleak oracle in open(2)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/02/02/1', 'name': '[oss-security] 20200202 Re: Linux kernel: user-triggerable read-after-free crash or 1-bit infoleak oracle in open(2)', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200313-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200313-0003/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00021.html', 'name': 'openSUSE-SU-2020:0336', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4320-1/', 'name': 'USN-4320-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4318-1/', 'name': 'USN-4318-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://packetstormsecurity.com/files/157233/Kernel-Live-Patch-Security-Notice-LSN-0065-1.html', 'name': 'http://packetstormsecurity.com/files/157233/Kernel-Live-Patch-Security-Notice-LSN-0065-1.html', 'refsource': 'MISC', 'tags': []}, {'url': 'https://usn.ubuntu.com/4324-1/', 'name': 'USN-4324-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4325-1/', 'name': 'USN-4325-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4319-1/', 'name': 'USN-4319-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4667', 'name': 'DSA-4667', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.19', 'versionEndExcluding': '5.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'fs/namei.c in the Linux kernel before 5.5 has a may_create_in_sticky use-after-free, which allows local users to cause a denial of service (OOPS) or possibly obtain sensitive information from kernel memory, aka CID-d0cb50185ae9. One attack vector may be an open system call for a UNIX domain socket, if the socket is being moved to a new parent directory and its old parent directory is being removed.'}]
2020-06-10T20:15Z
2020-01-29T00:15Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. 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. 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.
https://cwe.mitre.org/data/definitions/416.html
0
Al Viro
2020-01-26 09:29:34-05:00
do_last(): fetch directory ->i_mode and ->i_uid before it's too late may_create_in_sticky() call is done when we already have dropped the reference to dir. Fixes: 30aba6656f61e (namei: allow restricted O_CREAT of FIFOs and regular files) Signed-off-by: Al Viro <[email protected]>
d0cb50185ae942b03c4327be322055d622dc79f6
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
do_last
do_last( struct nameidata * nd , struct file * file , const struct open_flags * op)
['nd', 'file', 'op']
static int do_last(struct nameidata *nd, struct file *file, const struct open_flags *op) { struct dentry *dir = nd->path.dentry; int open_flag = op->open_flag; bool will_truncate = (open_flag & O_TRUNC) != 0; bool got_write = false; int acc_mode = op->acc_mode; unsigned seq; struct inode *inode; struct path path; int error; nd->flags &= ~LOOKUP_PARENT; nd->flags |= op->intent; if (nd->last_type != LAST_NORM) { error = handle_dots(nd, nd->last_type); if (unlikely(error)) return error; goto finish_open; } if (!(open_flag & O_CREAT)) { if (nd->last.name[nd->last.len]) nd->flags |= LOOKUP_FOLLOW | LOOKUP_DIRECTORY; /* we _can_ be in RCU mode here */ error = lookup_fast(nd, &path, &inode, &seq); if (likely(error > 0)) goto finish_lookup; if (error < 0) return error; BUG_ON(nd->inode != dir->d_inode); BUG_ON(nd->flags & LOOKUP_RCU); } else { /* create side of things */ /* * This will *only* deal with leaving RCU mode - LOOKUP_JUMPED * has been cleared when we got to the last component we are * about to look up */ error = complete_walk(nd); if (error) return error; audit_inode(nd->name, dir, AUDIT_INODE_PARENT); /* trailing slashes? */ if (unlikely(nd->last.name[nd->last.len])) return -EISDIR; } if (open_flag & (O_CREAT | O_TRUNC | O_WRONLY | O_RDWR)) { error = mnt_want_write(nd->path.mnt); if (!error) got_write = true; /* * do _not_ fail yet - we might not need that or fail with * a different error; let lookup_open() decide; we'll be * dropping this one anyway. */ } if (open_flag & O_CREAT) inode_lock(dir->d_inode); else inode_lock_shared(dir->d_inode); error = lookup_open(nd, &path, file, op, got_write); if (open_flag & O_CREAT) inode_unlock(dir->d_inode); else inode_unlock_shared(dir->d_inode); if (error) goto out; if (file->f_mode & FMODE_OPENED) { if ((file->f_mode & FMODE_CREATED) || !S_ISREG(file_inode(file)->i_mode)) will_truncate = false; audit_inode(nd->name, file->f_path.dentry, 0); goto opened; } if (file->f_mode & FMODE_CREATED) { /* Don't check for write permission, don't truncate */ open_flag &= ~O_TRUNC; will_truncate = false; acc_mode = 0; path_to_nameidata(&path, nd); goto finish_open_created; } /* * If atomic_open() acquired write access it is dropped now due to * possible mount and symlink following (this might be optimized away if * necessary...) */ if (got_write) { mnt_drop_write(nd->path.mnt); got_write = false; } error = follow_managed(&path, nd); if (unlikely(error < 0)) return error; /* * create/update audit record if it already exists. */ audit_inode(nd->name, path.dentry, 0); if (unlikely((open_flag & (O_EXCL | O_CREAT)) == (O_EXCL | O_CREAT))) { path_to_nameidata(&path, nd); return -EEXIST; } seq = 0; /* out of RCU mode, so the value doesn't matter */ inode = d_backing_inode(path.dentry); finish_lookup: error = step_into(nd, &path, 0, inode, seq); if (unlikely(error)) return error; finish_open: /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */ error = complete_walk(nd); if (error) return error; audit_inode(nd->name, nd->path.dentry, 0); if (open_flag & O_CREAT) { error = -EISDIR; if (d_is_dir(nd->path.dentry)) goto out; error = may_create_in_sticky(dir, d_backing_inode(nd->path.dentry)); if (unlikely(error)) goto out; } error = -ENOTDIR; if ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentry)) goto out; if (!d_is_reg(nd->path.dentry)) will_truncate = false; if (will_truncate) { error = mnt_want_write(nd->path.mnt); if (error) goto out; got_write = true; } finish_open_created: error = may_open(&nd->path, acc_mode, open_flag); if (error) goto out; BUG_ON(file->f_mode & FMODE_OPENED); /* once it's opened, it's opened */ error = vfs_open(&nd->path, file); if (error) goto out; opened: error = ima_file_check(file, op->acc_mode); if (!error && will_truncate) error = handle_truncate(file); out: if (unlikely(error > 0)) { WARN_ON(1); error = -EINVAL; } if (got_write) mnt_drop_write(nd->path.mnt); return error; }
855
True
1
CVE-2020-8428
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:P
LOCAL
LOW
NONE
PARTIAL
NONE
PARTIAL
3.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
NONE
HIGH
7.1
HIGH
1.8
5.2
False
[{'url': 'https://github.com/torvalds/linux/commit/d0cb50185ae942b03c4327be322055d622dc79f6', 'name': 'https://github.com/torvalds/linux/commit/d0cb50185ae942b03c4327be322055d622dc79f6', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2020/01/28/2', 'name': 'https://www.openwall.com/lists/oss-security/2020/01/28/2', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d0cb50185ae942b03c4327be322055d622dc79f6', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d0cb50185ae942b03c4327be322055d622dc79f6', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Vendor Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/01/28/4', 'name': '[oss-security] 20200129 Re: Linux kernel: user-triggerable read-after-free crash or 1-bit infoleak oracle in open(2)', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'http://www.openwall.com/lists/oss-security/2020/02/02/1', 'name': '[oss-security] 20200202 Re: Linux kernel: user-triggerable read-after-free crash or 1-bit infoleak oracle in open(2)', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200313-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200313-0003/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00021.html', 'name': 'openSUSE-SU-2020:0336', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4320-1/', 'name': 'USN-4320-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4318-1/', 'name': 'USN-4318-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://packetstormsecurity.com/files/157233/Kernel-Live-Patch-Security-Notice-LSN-0065-1.html', 'name': 'http://packetstormsecurity.com/files/157233/Kernel-Live-Patch-Security-Notice-LSN-0065-1.html', 'refsource': 'MISC', 'tags': []}, {'url': 'https://usn.ubuntu.com/4324-1/', 'name': 'USN-4324-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4325-1/', 'name': 'USN-4325-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4319-1/', 'name': 'USN-4319-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4667', 'name': 'DSA-4667', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.19', 'versionEndExcluding': '5.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'fs/namei.c in the Linux kernel before 5.5 has a may_create_in_sticky use-after-free, which allows local users to cause a denial of service (OOPS) or possibly obtain sensitive information from kernel memory, aka CID-d0cb50185ae9. One attack vector may be an open system call for a UNIX domain socket, if the socket is being moved to a new parent directory and its old parent directory is being removed.'}]
2020-06-10T20:15Z
2020-01-29T00:15Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. 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. 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.
https://cwe.mitre.org/data/definitions/416.html
0
Al Viro
2020-01-26 09:29:34-05:00
do_last(): fetch directory ->i_mode and ->i_uid before it's too late may_create_in_sticky() call is done when we already have dropped the reference to dir. Fixes: 30aba6656f61e (namei: allow restricted O_CREAT of FIFOs and regular files) Signed-off-by: Al Viro <[email protected]>
d0cb50185ae942b03c4327be322055d622dc79f6
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
may_create_in_sticky
may_create_in_sticky( struct dentry * const dir , struct inode * const inode)
['dir', 'inode']
static int may_create_in_sticky(struct dentry * const dir, struct inode * const inode) { if ((!sysctl_protected_fifos && S_ISFIFO(inode->i_mode)) || (!sysctl_protected_regular && S_ISREG(inode->i_mode)) || likely(!(dir->d_inode->i_mode & S_ISVTX)) || uid_eq(inode->i_uid, dir->d_inode->i_uid) || uid_eq(current_fsuid(), inode->i_uid)) return 0; if (likely(dir->d_inode->i_mode & 0002) || (dir->d_inode->i_mode & 0020 && ((sysctl_protected_fifos >= 2 && S_ISFIFO(inode->i_mode)) || (sysctl_protected_regular >= 2 && S_ISREG(inode->i_mode))))) { const char *operation = S_ISFIFO(inode->i_mode) ? "sticky_create_fifo" : "sticky_create_regular"; audit_log_path_denied(AUDIT_ANOM_CREAT, operation); return -EACCES; } return 0; }
166
True
1
CVE-2020-9383
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:P
LOCAL
LOW
NONE
PARTIAL
NONE
PARTIAL
3.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
NONE
HIGH
7.1
HIGH
1.8
5.2
False
[{'url': 'https://github.com/torvalds/linux/commit/2e90ca68b0d2f5548804f22f0dd61145516171e3', 'name': 'https://github.com/torvalds/linux/commit/2e90ca68b0d2f5548804f22f0dd61145516171e3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200313-0003/', 'name': 'https://security.netapp.com/advisory/ntap-20200313-0003/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00039.html', 'name': 'openSUSE-SU-2020:0388', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4344-1/', 'name': 'USN-4344-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4345-1/', 'name': 'USN-4345-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4342-1/', 'name': 'USN-4342-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4346-1/', 'name': 'USN-4346-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=2f9ac30a54dc0181ddac3705cdcf4775d863c530', 'name': 'https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=2f9ac30a54dc0181ddac3705cdcf4775d863c530', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.5.6', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in the Linux kernel 3.16 through 5.5.6. set_fdc in drivers/block/floppy.c leads to a wait_til_ready out-of-bounds read because the FDC index is not checked for errors before assigning it, aka CID-2e90ca68b0d2.'}]
2021-01-04T23:15Z
2020-02-25T16:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Linus Torvalds
2020-02-21 12:43:35-08:00
floppy: check FDC index for errors before assigning it Jordy Zomer reported a KASAN out-of-bounds read in the floppy driver in wait_til_ready(). Which on the face of it can't happen, since as Willy Tarreau points out, the function does no particular memory access. Except through the FDCS macro, which just indexes a static allocation through teh current fdc, which is always checked against N_FDC. Except the checking happens after we've already assigned the value. The floppy driver is a disgrace (a lot of it going back to my original horrd "design"), and has no real maintainer. Nobody has the hardware, and nobody really cares. But it still gets used in virtual environment because it's one of those things that everybody supports. The whole thing should be re-written, or at least parts of it should be seriously cleaned up. The 'current fdc' index, which is used by the FDCS macro, and which is often shadowed by a local 'fdc' variable, is a prime example of how not to write code. But because nobody has the hardware or the motivation, let's just fix up the immediate problem with a nasty band-aid: test the fdc index before actually assigning it to the static 'fdc' variable. Reported-by: Jordy Zomer <[email protected]> Cc: Willy Tarreau <[email protected]> Cc: Dan Carpenter <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2e90ca68b0d2f5548804f22f0dd61145516171e3
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
set_fdc
set_fdc( int drive)
['drive']
static void set_fdc(int drive) { if (drive >= 0 && drive < N_DRIVE) { fdc = FDC(drive); current_drive = drive; } if (fdc != 1 && fdc != 0) { pr_info("bad fdc value\n"); return; } set_dor(fdc, ~0, 8); #if N_FDC > 1 set_dor(1 - fdc, ~8, 0); #endif if (FDCS->rawcmd == 2) reset_fdc_info(1); if (fd_inb(FD_STATUS) != STATUS_READY) FDCS->reset = 1; }
97
True
1
CVE-2020-12465
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
6.7
MEDIUM
0.8
5.9
False
[{'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.5.10', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.5.10', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/b102f0c522cf668c8382c56a4f771b37d011cda2', 'name': 'https://github.com/torvalds/linux/commit/b102f0c522cf668c8382c56a4f771b37d011cda2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b102f0c522cf668c8382c56a4f771b37d011cda2', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b102f0c522cf668c8382c56a4f771b37d011cda2', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.5.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An array overflow was discovered in mt76_add_fragment in drivers/net/wireless/mediatek/mt76/dma.c in the Linux kernel before 5.5.10, aka CID-b102f0c522cf. An oversized packet with too many rx fragments can corrupt memory of adjacent pages.'}]
2020-06-08T13:15Z
2020-04-29T19:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
Felix Fietkau
2020-02-20 12:41:39+01:00
mt76: fix array overflow on receiving too many fragments for a packet If the hardware receives an oversized packet with too many rx fragments, skb_shinfo(skb)->frags can overflow and corrupt memory of adjacent pages. This becomes especially visible if it corrupts the freelist pointer of a slab page. Cc: [email protected] Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
b102f0c522cf668c8382c56a4f771b37d011cda2
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mt76_add_fragment
mt76_add_fragment( struct mt76_dev * dev , struct mt76_queue * q , void * data , int len , bool more)
['dev', 'q', 'data', 'len', 'more']
mt76_add_fragment(struct mt76_dev *dev, struct mt76_queue *q, void *data, int len, bool more) { struct page *page = virt_to_head_page(data); int offset = data - page_address(page); struct sk_buff *skb = q->rx_head; offset += q->buf_offset; skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, offset, len, q->buf_size); if (more) return; q->rx_head = NULL; dev->drv->rx_skb(dev, q - dev->q_rx, skb); }
110
True
1
CVE-2020-11609
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:C
LOCAL
LOW
NONE
NONE
NONE
COMPLETE
4.9
CVSS:3.1/AV:P/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
PHYSICAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
4.3
MEDIUM
0.7
3.6
False
[{'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=485b06aadb933190f4bc44e006076bc27a23f205', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=485b06aadb933190f4bc44e006076bc27a23f205', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.1', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/485b06aadb933190f4bc44e006076bc27a23f205', 'name': 'https://github.com/torvalds/linux/commit/485b06aadb933190f4bc44e006076bc27a23f205', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4345-1/', 'name': 'USN-4345-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4364-1/', 'name': 'USN-4364-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4368-1/', 'name': 'USN-4368-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4369-1/', 'name': 'USN-4369-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.6.1', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in the stv06xx subsystem in the Linux kernel before 5.6.1. drivers/media/usb/gspca/stv06xx/stv06xx.c and drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c mishandle invalid descriptors, as demonstrated by a NULL pointer dereference, aka CID-485b06aadb93.'}]
2020-06-13T09:15Z
2020-04-07T17:15Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Johan Hovold
2020-01-03 17:35:10+01:00
media: stv06xx: add missing descriptor sanity checks Make sure to check that we have two alternate settings and at least one endpoint before accessing the second altsetting structure and dereferencing the endpoint arrays. This specifically avoids dereferencing NULL-pointers or corrupting memory when a device does not have the expected descriptors. Note that the sanity checks in stv06xx_start() and pb0100_start() are not redundant as the driver is mixing looking up altsettings by index and by number, which may not coincide. Fixes: 8668d504d72c ("V4L/DVB (12082): gspca_stv06xx: Add support for st6422 bridge and sensor") Fixes: c0b33bdc5b8d ("[media] gspca-stv06xx: support bandwidth changing") Cc: stable <[email protected]> # 2.6.31 Cc: Hans de Goede <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
485b06aadb933190f4bc44e006076bc27a23f205
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
stv06xx_isoc_init
stv06xx_isoc_init( struct gspca_dev * gspca_dev)
['gspca_dev']
static int stv06xx_isoc_init(struct gspca_dev *gspca_dev) { struct usb_host_interface *alt; struct sd *sd = (struct sd *) gspca_dev; /* Start isoc bandwidth "negotiation" at max isoc bandwidth */ alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1]; alt->endpoint[0].desc.wMaxPacketSize = cpu_to_le16(sd->sensor->max_packet_size[gspca_dev->curr_mode]); return 0; }
73
True
1
CVE-2020-11668
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:P/A:C
LOCAL
LOW
NONE
NONE
PARTIAL
COMPLETE
5.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
HIGH
HIGH
7.1
HIGH
1.8
5.2
False
[{'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.1', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.1', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/a246b4d547708f33ff4d4b9a7a5dbac741dc89d8', 'name': 'https://github.com/torvalds/linux/commit/a246b4d547708f33ff4d4b9a7a5dbac741dc89d8', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a246b4d547708f33ff4d4b9a7a5dbac741dc89d8', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a246b4d547708f33ff4d4b9a7a5dbac741dc89d8', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://usn.ubuntu.com/4345-1/', 'name': 'USN-4345-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4364-1/', 'name': 'USN-4364-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4368-1/', 'name': 'USN-4368-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4369-1/', 'name': 'USN-4369-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.6.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In the Linux kernel before 5.6.1, drivers/media/usb/gspca/xirlink_cit.c (aka the Xirlink camera USB driver) mishandles invalid descriptors, aka CID-a246b4d54770.'}]
2020-06-10T20:15Z
2020-04-09T21:15Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Johan Hovold
2020-01-03 17:35:11+01:00
media: xirlink_cit: add missing descriptor sanity checks Make sure to check that we have two alternate settings and at least one endpoint before accessing the second altsetting structure and dereferencing the endpoint arrays. This specifically avoids dereferencing NULL-pointers or corrupting memory when a device does not have the expected descriptors. Note that the sanity check in cit_get_packet_size() is not redundant as the driver is mixing looking up altsettings by index and by number, which may not coincide. Fixes: 659fefa0eb17 ("V4L/DVB: gspca_xirlink_cit: Add support for camera with a bcd version of 0.01") Fixes: 59f8b0bf3c12 ("V4L/DVB: gspca_xirlink_cit: support bandwidth changing for devices with 1 alt setting") Cc: stable <[email protected]> # 2.6.37 Cc: Hans de Goede <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
a246b4d547708f33ff4d4b9a7a5dbac741dc89d8
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
sd_isoc_init
sd_isoc_init( struct gspca_dev * gspca_dev)
['gspca_dev']
static int sd_isoc_init(struct gspca_dev *gspca_dev) { struct usb_host_interface *alt; int max_packet_size; switch (gspca_dev->pixfmt.width) { case 160: max_packet_size = 450; break; case 176: max_packet_size = 600; break; default: max_packet_size = 1022; break; } /* Start isoc bandwidth "negotiation" at max isoc bandwidth */ alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1]; alt->endpoint[0].desc.wMaxPacketSize = cpu_to_le16(max_packet_size); return 0; }
91
True
1
CVE-2021-3715
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=1993988', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=1993988', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.openwall.com/lists/oss-security/2021/09/07/1', 'name': 'https://www.openwall.com/lists/oss-security/2021/09/07/1', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef299cc3fa1a9e1288665a9fdc8bff55629fd359', 'name': 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef299cc3fa1a9e1288665a9fdc8bff55629fd359', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/ef299cc3fa1a9e1288665a9fdc8bff55629fd359', 'name': 'https://github.com/torvalds/linux/commit/ef299cc3fa1a9e1288665a9fdc8bff55629fd359', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.10', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A flaw was found in the "Routing decision" classifier in the Linux kernel\'s Traffic Control networking subsystem in the way it handled changing of classification filters, leading to a use-after-free condition. This flaw allows unprivileged local users to escalate their privileges on the system. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.'}]
2022-03-10T21:34Z
2022-03-02T23:15Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. 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. 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.
https://cwe.mitre.org/data/definitions/416.html
0
Cong Wang
2020-03-13 22:29:54-07:00
net_sched: cls_route: remove the right filter from hashtable route4_change() allocates a new filter and copies values from the old one. After the new filter is inserted into the hash table, the old filter should be removed and freed, as the final step of the update. However, the current code mistakenly removes the new one. This looks apparently wrong to me, and it causes double "free" and use-after-free too, as reported by syzbot. Reported-and-tested-by: [email protected] Reported-and-tested-by: [email protected] Reported-and-tested-by: [email protected] Fixes: 1109c00547fc ("net: sched: RCU cls_route") Cc: Jamal Hadi Salim <[email protected]> Cc: Jiri Pirko <[email protected]> Cc: John Fastabend <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
ef299cc3fa1a9e1288665a9fdc8bff55629fd359
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
route4_change
route4_change( struct net * net , struct sk_buff * in_skb , struct tcf_proto * tp , unsigned long base , u32 handle , struct nlattr ** tca , void ** arg , bool ovr , bool rtnl_held , struct netlink_ext_ack * extack)
['net', 'in_skb', 'tp', 'base', 'handle', 'tca', 'arg', 'ovr', 'rtnl_held', 'extack']
static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held, struct netlink_ext_ack *extack) { struct route4_head *head = rtnl_dereference(tp->root); struct route4_filter __rcu **fp; struct route4_filter *fold, *f1, *pfp, *f = NULL; struct route4_bucket *b; struct nlattr *opt = tca[TCA_OPTIONS]; struct nlattr *tb[TCA_ROUTE4_MAX + 1]; unsigned int h, th; int err; bool new = true; if (opt == NULL) return handle ? -EINVAL : 0; err = nla_parse_nested_deprecated(tb, TCA_ROUTE4_MAX, opt, route4_policy, NULL); if (err < 0) return err; fold = *arg; if (fold && handle && fold->handle != handle) return -EINVAL; err = -ENOBUFS; f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL); if (!f) goto errout; err = tcf_exts_init(&f->exts, net, TCA_ROUTE4_ACT, TCA_ROUTE4_POLICE); if (err < 0) goto errout; if (fold) { f->id = fold->id; f->iif = fold->iif; f->res = fold->res; f->handle = fold->handle; f->tp = fold->tp; f->bkt = fold->bkt; new = false; } err = route4_set_parms(net, tp, base, f, handle, head, tb, tca[TCA_RATE], new, ovr, extack); if (err < 0) goto errout; h = from_hash(f->handle >> 16); fp = &f->bkt->ht[h]; for (pfp = rtnl_dereference(*fp); (f1 = rtnl_dereference(*fp)) != NULL; fp = &f1->next) if (f->handle < f1->handle) break; tcf_block_netif_keep_dst(tp->chain->block); rcu_assign_pointer(f->next, f1); rcu_assign_pointer(*fp, f); if (fold && fold->handle && f->handle != fold->handle) { th = to_hash(fold->handle); h = from_hash(fold->handle >> 16); b = rtnl_dereference(head->table[th]); if (b) { fp = &b->ht[h]; for (pfp = rtnl_dereference(*fp); pfp; fp = &pfp->next, pfp = rtnl_dereference(*fp)) { if (pfp == f) { *fp = f->next; break; } } } } route4_reset_fastmap(head); *arg = f; if (fold) { tcf_unbind_filter(tp, &fold->res); tcf_exts_get_net(&fold->exts); tcf_queue_work(&fold->rwork, route4_delete_filter_work); } return 0; errout: if (f) tcf_exts_destroy(&f->exts); kfree(f); return err; }
599
True
1
CVE-2020-12657
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.5', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.5', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://patchwork.kernel.org/patch/11447049/', 'name': 'https://patchwork.kernel.org/patch/11447049/', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'name': 'https://github.com/torvalds/linux/commit/2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4367-1/', 'name': 'USN-4367-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4368-1/', 'name': 'USN-4368-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4363-1/', 'name': 'USN-4363-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4369-1/', 'name': 'USN-4369-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.6.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in the Linux kernel before 5.6.5. There is a use-after-free in block/bfq-iosched.c related to bfq_idle_slice_timer_body.'}]
2020-06-13T09:15Z
2020-05-05T07:15Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. 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. 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.
https://cwe.mitre.org/data/definitions/416.html
0
Zhiqiang Liu
2020-03-19 19:18:13+08:00
block, bfq: fix use-after-free in bfq_idle_slice_timer_body In bfq_idle_slice_timer func, bfqq = bfqd->in_service_queue is not in bfqd-lock critical section. The bfqq, which is not equal to NULL in bfq_idle_slice_timer, may be freed after passing to bfq_idle_slice_timer_body. So we will access the freed memory. In addition, considering the bfqq may be in race, we should firstly check whether bfqq is in service before doing something on it in bfq_idle_slice_timer_body func. If the bfqq in race is not in service, it means the bfqq has been expired through __bfq_bfqq_expire func, and wait_request flags has been cleared in __bfq_bfqd_reset_in_service func. So we do not need to re-clear the wait_request of bfqq which is not in service. KASAN log is given as follows: [13058.354613] ================================================================== [13058.354640] BUG: KASAN: use-after-free in bfq_idle_slice_timer+0xac/0x290 [13058.354644] Read of size 8 at addr ffffa02cf3e63f78 by task fork13/19767 [13058.354646] [13058.354655] CPU: 96 PID: 19767 Comm: fork13 [13058.354661] Call trace: [13058.354667] dump_backtrace+0x0/0x310 [13058.354672] show_stack+0x28/0x38 [13058.354681] dump_stack+0xd8/0x108 [13058.354687] print_address_description+0x68/0x2d0 [13058.354690] kasan_report+0x124/0x2e0 [13058.354697] __asan_load8+0x88/0xb0 [13058.354702] bfq_idle_slice_timer+0xac/0x290 [13058.354707] __hrtimer_run_queues+0x298/0x8b8 [13058.354710] hrtimer_interrupt+0x1b8/0x678 [13058.354716] arch_timer_handler_phys+0x4c/0x78 [13058.354722] handle_percpu_devid_irq+0xf0/0x558 [13058.354731] generic_handle_irq+0x50/0x70 [13058.354735] __handle_domain_irq+0x94/0x110 [13058.354739] gic_handle_irq+0x8c/0x1b0 [13058.354742] el1_irq+0xb8/0x140 [13058.354748] do_wp_page+0x260/0xe28 [13058.354752] __handle_mm_fault+0x8ec/0x9b0 [13058.354756] handle_mm_fault+0x280/0x460 [13058.354762] do_page_fault+0x3ec/0x890 [13058.354765] do_mem_abort+0xc0/0x1b0 [13058.354768] el0_da+0x24/0x28 [13058.354770] [13058.354773] Allocated by task 19731: [13058.354780] kasan_kmalloc+0xe0/0x190 [13058.354784] kasan_slab_alloc+0x14/0x20 [13058.354788] kmem_cache_alloc_node+0x130/0x440 [13058.354793] bfq_get_queue+0x138/0x858 [13058.354797] bfq_get_bfqq_handle_split+0xd4/0x328 [13058.354801] bfq_init_rq+0x1f4/0x1180 [13058.354806] bfq_insert_requests+0x264/0x1c98 [13058.354811] blk_mq_sched_insert_requests+0x1c4/0x488 [13058.354818] blk_mq_flush_plug_list+0x2d4/0x6e0 [13058.354826] blk_flush_plug_list+0x230/0x548 [13058.354830] blk_finish_plug+0x60/0x80 [13058.354838] read_pages+0xec/0x2c0 [13058.354842] __do_page_cache_readahead+0x374/0x438 [13058.354846] ondemand_readahead+0x24c/0x6b0 [13058.354851] page_cache_sync_readahead+0x17c/0x2f8 [13058.354858] generic_file_buffered_read+0x588/0xc58 [13058.354862] generic_file_read_iter+0x1b4/0x278 [13058.354965] ext4_file_read_iter+0xa8/0x1d8 [ext4] [13058.354972] __vfs_read+0x238/0x320 [13058.354976] vfs_read+0xbc/0x1c0 [13058.354980] ksys_read+0xdc/0x1b8 [13058.354984] __arm64_sys_read+0x50/0x60 [13058.354990] el0_svc_common+0xb4/0x1d8 [13058.354994] el0_svc_handler+0x50/0xa8 [13058.354998] el0_svc+0x8/0xc [13058.354999] [13058.355001] Freed by task 19731: [13058.355007] __kasan_slab_free+0x120/0x228 [13058.355010] kasan_slab_free+0x10/0x18 [13058.355014] kmem_cache_free+0x288/0x3f0 [13058.355018] bfq_put_queue+0x134/0x208 [13058.355022] bfq_exit_icq_bfqq+0x164/0x348 [13058.355026] bfq_exit_icq+0x28/0x40 [13058.355030] ioc_exit_icq+0xa0/0x150 [13058.355035] put_io_context_active+0x250/0x438 [13058.355038] exit_io_context+0xd0/0x138 [13058.355045] do_exit+0x734/0xc58 [13058.355050] do_group_exit+0x78/0x220 [13058.355054] __wake_up_parent+0x0/0x50 [13058.355058] el0_svc_common+0xb4/0x1d8 [13058.355062] el0_svc_handler+0x50/0xa8 [13058.355066] el0_svc+0x8/0xc [13058.355067] [13058.355071] The buggy address belongs to the object at ffffa02cf3e63e70#012 which belongs to the cache bfq_queue of size 464 [13058.355075] The buggy address is located 264 bytes inside of#012 464-byte region [ffffa02cf3e63e70, ffffa02cf3e64040) [13058.355077] The buggy address belongs to the page: [13058.355083] page:ffff7e80b3cf9800 count:1 mapcount:0 mapping:ffff802db5c90780 index:0xffffa02cf3e606f0 compound_mapcount: 0 [13058.366175] flags: 0x2ffffe0000008100(slab|head) [13058.370781] raw: 2ffffe0000008100 ffff7e80b53b1408 ffffa02d730c1c90 ffff802db5c90780 [13058.370787] raw: ffffa02cf3e606f0 0000000000370023 00000001ffffffff 0000000000000000 [13058.370789] page dumped because: kasan: bad access detected [13058.370791] [13058.370792] Memory state around the buggy address: [13058.370797] ffffa02cf3e63e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fb fb [13058.370801] ffffa02cf3e63e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [13058.370805] >ffffa02cf3e63f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [13058.370808] ^ [13058.370811] ffffa02cf3e63f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [13058.370815] ffffa02cf3e64000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [13058.370817] ================================================================== [13058.370820] Disabling lock debugging due to kernel taint Here, we directly pass the bfqd to bfq_idle_slice_timer_body func. -- V2->V3: rewrite the comment as suggested by Paolo Valente V1->V2: add one comment, and add Fixes and Reported-by tag. Fixes: aee69d78d ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler") Acked-by: Paolo Valente <[email protected]> Reported-by: Wang Wang <[email protected]> Signed-off-by: Zhiqiang Liu <[email protected]> Signed-off-by: Feilong Lin <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
bfq_idle_slice_timer
bfq_idle_slice_timer( struct hrtimer * timer)
['timer']
*/ static enum hrtimer_restart bfq_idle_slice_timer(struct hrtimer *timer) { struct bfq_data *bfqd = container_of(timer, struct bfq_data, idle_slice_timer); struct bfq_queue *bfqq = bfqd->in_service_queue; /* * Theoretical race here: the in-service queue can be NULL or * different from the queue that was idling if a new request * arrives for the current queue and there is a full dispatch * cycle that changes the in-service queue. This can hardly * happen, but in the worst case we just expire a queue too * early. */ if (bfqq) bfq_idle_slice_timer_body(bfqq); return HRTIMER_NORESTART;
45
True
1
CVE-2020-12657
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:P/A:P
LOCAL
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
4.6
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.5', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.5', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://patchwork.kernel.org/patch/11447049/', 'name': 'https://patchwork.kernel.org/patch/11447049/', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'name': 'https://github.com/torvalds/linux/commit/2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4367-1/', 'name': 'USN-4367-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4368-1/', 'name': 'USN-4368-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4363-1/', 'name': 'USN-4363-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4369-1/', 'name': 'USN-4369-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.6.5', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in the Linux kernel before 5.6.5. There is a use-after-free in block/bfq-iosched.c related to bfq_idle_slice_timer_body.'}]
2020-06-13T09:15Z
2020-05-05T07:15Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. 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. 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.
https://cwe.mitre.org/data/definitions/416.html
0
Zhiqiang Liu
2020-03-19 19:18:13+08:00
block, bfq: fix use-after-free in bfq_idle_slice_timer_body In bfq_idle_slice_timer func, bfqq = bfqd->in_service_queue is not in bfqd-lock critical section. The bfqq, which is not equal to NULL in bfq_idle_slice_timer, may be freed after passing to bfq_idle_slice_timer_body. So we will access the freed memory. In addition, considering the bfqq may be in race, we should firstly check whether bfqq is in service before doing something on it in bfq_idle_slice_timer_body func. If the bfqq in race is not in service, it means the bfqq has been expired through __bfq_bfqq_expire func, and wait_request flags has been cleared in __bfq_bfqd_reset_in_service func. So we do not need to re-clear the wait_request of bfqq which is not in service. KASAN log is given as follows: [13058.354613] ================================================================== [13058.354640] BUG: KASAN: use-after-free in bfq_idle_slice_timer+0xac/0x290 [13058.354644] Read of size 8 at addr ffffa02cf3e63f78 by task fork13/19767 [13058.354646] [13058.354655] CPU: 96 PID: 19767 Comm: fork13 [13058.354661] Call trace: [13058.354667] dump_backtrace+0x0/0x310 [13058.354672] show_stack+0x28/0x38 [13058.354681] dump_stack+0xd8/0x108 [13058.354687] print_address_description+0x68/0x2d0 [13058.354690] kasan_report+0x124/0x2e0 [13058.354697] __asan_load8+0x88/0xb0 [13058.354702] bfq_idle_slice_timer+0xac/0x290 [13058.354707] __hrtimer_run_queues+0x298/0x8b8 [13058.354710] hrtimer_interrupt+0x1b8/0x678 [13058.354716] arch_timer_handler_phys+0x4c/0x78 [13058.354722] handle_percpu_devid_irq+0xf0/0x558 [13058.354731] generic_handle_irq+0x50/0x70 [13058.354735] __handle_domain_irq+0x94/0x110 [13058.354739] gic_handle_irq+0x8c/0x1b0 [13058.354742] el1_irq+0xb8/0x140 [13058.354748] do_wp_page+0x260/0xe28 [13058.354752] __handle_mm_fault+0x8ec/0x9b0 [13058.354756] handle_mm_fault+0x280/0x460 [13058.354762] do_page_fault+0x3ec/0x890 [13058.354765] do_mem_abort+0xc0/0x1b0 [13058.354768] el0_da+0x24/0x28 [13058.354770] [13058.354773] Allocated by task 19731: [13058.354780] kasan_kmalloc+0xe0/0x190 [13058.354784] kasan_slab_alloc+0x14/0x20 [13058.354788] kmem_cache_alloc_node+0x130/0x440 [13058.354793] bfq_get_queue+0x138/0x858 [13058.354797] bfq_get_bfqq_handle_split+0xd4/0x328 [13058.354801] bfq_init_rq+0x1f4/0x1180 [13058.354806] bfq_insert_requests+0x264/0x1c98 [13058.354811] blk_mq_sched_insert_requests+0x1c4/0x488 [13058.354818] blk_mq_flush_plug_list+0x2d4/0x6e0 [13058.354826] blk_flush_plug_list+0x230/0x548 [13058.354830] blk_finish_plug+0x60/0x80 [13058.354838] read_pages+0xec/0x2c0 [13058.354842] __do_page_cache_readahead+0x374/0x438 [13058.354846] ondemand_readahead+0x24c/0x6b0 [13058.354851] page_cache_sync_readahead+0x17c/0x2f8 [13058.354858] generic_file_buffered_read+0x588/0xc58 [13058.354862] generic_file_read_iter+0x1b4/0x278 [13058.354965] ext4_file_read_iter+0xa8/0x1d8 [ext4] [13058.354972] __vfs_read+0x238/0x320 [13058.354976] vfs_read+0xbc/0x1c0 [13058.354980] ksys_read+0xdc/0x1b8 [13058.354984] __arm64_sys_read+0x50/0x60 [13058.354990] el0_svc_common+0xb4/0x1d8 [13058.354994] el0_svc_handler+0x50/0xa8 [13058.354998] el0_svc+0x8/0xc [13058.354999] [13058.355001] Freed by task 19731: [13058.355007] __kasan_slab_free+0x120/0x228 [13058.355010] kasan_slab_free+0x10/0x18 [13058.355014] kmem_cache_free+0x288/0x3f0 [13058.355018] bfq_put_queue+0x134/0x208 [13058.355022] bfq_exit_icq_bfqq+0x164/0x348 [13058.355026] bfq_exit_icq+0x28/0x40 [13058.355030] ioc_exit_icq+0xa0/0x150 [13058.355035] put_io_context_active+0x250/0x438 [13058.355038] exit_io_context+0xd0/0x138 [13058.355045] do_exit+0x734/0xc58 [13058.355050] do_group_exit+0x78/0x220 [13058.355054] __wake_up_parent+0x0/0x50 [13058.355058] el0_svc_common+0xb4/0x1d8 [13058.355062] el0_svc_handler+0x50/0xa8 [13058.355066] el0_svc+0x8/0xc [13058.355067] [13058.355071] The buggy address belongs to the object at ffffa02cf3e63e70#012 which belongs to the cache bfq_queue of size 464 [13058.355075] The buggy address is located 264 bytes inside of#012 464-byte region [ffffa02cf3e63e70, ffffa02cf3e64040) [13058.355077] The buggy address belongs to the page: [13058.355083] page:ffff7e80b3cf9800 count:1 mapcount:0 mapping:ffff802db5c90780 index:0xffffa02cf3e606f0 compound_mapcount: 0 [13058.366175] flags: 0x2ffffe0000008100(slab|head) [13058.370781] raw: 2ffffe0000008100 ffff7e80b53b1408 ffffa02d730c1c90 ffff802db5c90780 [13058.370787] raw: ffffa02cf3e606f0 0000000000370023 00000001ffffffff 0000000000000000 [13058.370789] page dumped because: kasan: bad access detected [13058.370791] [13058.370792] Memory state around the buggy address: [13058.370797] ffffa02cf3e63e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fb fb [13058.370801] ffffa02cf3e63e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [13058.370805] >ffffa02cf3e63f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [13058.370808] ^ [13058.370811] ffffa02cf3e63f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [13058.370815] ffffa02cf3e64000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [13058.370817] ================================================================== [13058.370820] Disabling lock debugging due to kernel taint Here, we directly pass the bfqd to bfq_idle_slice_timer_body func. -- V2->V3: rewrite the comment as suggested by Paolo Valente V1->V2: add one comment, and add Fixes and Reported-by tag. Fixes: aee69d78d ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler") Acked-by: Paolo Valente <[email protected]> Reported-by: Wang Wang <[email protected]> Signed-off-by: Zhiqiang Liu <[email protected]> Signed-off-by: Feilong Lin <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2f95fa5c955d0a9987ffdc3a095e2f4e62c5f2a9
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
bfq_idle_slice_timer_body
bfq_idle_slice_timer_body( struct bfq_queue * bfqq)
['bfqq']
static void bfq_idle_slice_timer_body(struct bfq_queue *bfqq) { struct bfq_data *bfqd = bfqq->bfqd; enum bfqq_expiration reason; unsigned long flags; spin_lock_irqsave(&bfqd->lock, flags); bfq_clear_bfqq_wait_request(bfqq); if (bfqq != bfqd->in_service_queue) { spin_unlock_irqrestore(&bfqd->lock, flags); return; } if (bfq_bfqq_budget_timeout(bfqq)) /* * Also here the queue can be safely expired * for budget timeout without wasting * guarantees */ reason = BFQQE_BUDGET_TIMEOUT; else if (bfqq->queued[0] == 0 && bfqq->queued[1] == 0) /* * The queue may not be empty upon timer expiration, * because we may not disable the timer when the * first request of the in-service queue arrives * during disk idling. */ reason = BFQQE_TOO_IDLE; else goto schedule_dispatch; bfq_bfqq_expire(bfqd, bfqq, true, reason); schedule_dispatch: spin_unlock_irqrestore(&bfqd->lock, flags); bfq_schedule_dispatch(bfqd);
131
True
1
CVE-2020-11494
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:N
LOCAL
LOW
NONE
PARTIAL
NONE
NONE
2.1
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
LOCAL
LOW
HIGH
NONE
UNCHANGED
HIGH
NONE
NONE
4.4
MEDIUM
0.8
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/b9258a2cece4ec1f020715fe3554bc2e360f6264', 'name': 'https://github.com/torvalds/linux/commit/b9258a2cece4ec1f020715fe3554bc2e360f6264', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00035.html', 'name': 'openSUSE-SU-2020:0543', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4364-1/', 'name': 'USN-4364-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4368-1/', 'name': 'USN-4368-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4363-1/', 'name': 'USN-4363-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4369-1/', 'name': 'USN-4369-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/159565/Kernel-Live-Patch-Security-Notice-LSN-0072-1.html', 'name': 'http://packetstormsecurity.com/files/159565/Kernel-Live-Patch-Security-Notice-LSN-0072-1.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=08fadc32ce6239dc75fd5e869590e29bc62bbc28', 'name': 'https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=08fadc32ce6239dc75fd5e869590e29bc62bbc28', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Vendor Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}, {'lang': 'en', 'value': 'CWE-909'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.16', 'versionEndIncluding': '5.6.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slc_bump in drivers/net/can/slcan.c in the Linux kernel 3.16 through 5.6.2. It allows attackers to read uninitialized can_frame data, potentially containing sensitive information from kernel stack memory, if the configuration lacks CONFIG_INIT_STACK_ALL, aka CID-b9258a2cece4.'}]
2022-04-29T13:26Z
2020-04-02T21:15Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
Richard Palethorpe
2020-04-01 12:06:39+02:00
slcan: Don't transmit uninitialized stack data in padding struct can_frame contains some padding which is not explicitly zeroed in slc_bump. This uninitialized data will then be transmitted if the stack initialization hardening feature is not enabled (CONFIG_INIT_STACK_ALL). This commit just zeroes the whole struct including the padding. Signed-off-by: Richard Palethorpe <[email protected]> Fixes: a1044e36e457 ("can: add slcan driver for serial/USB-serial CAN adapters") Reviewed-by: Kees Cook <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Marc Kleine-Budde <[email protected]> Signed-off-by: David S. Miller <[email protected]>
b9258a2cece4ec1f020715fe3554bc2e360f6264
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
slc_bump
slc_bump( struct slcan * sl)
['sl']
static void slc_bump(struct slcan *sl) { struct sk_buff *skb; struct can_frame cf; int i, tmp; u32 tmpid; char *cmd = sl->rbuff; cf.can_id = 0; switch (*cmd) { case 'r': cf.can_id = CAN_RTR_FLAG; /* fallthrough */ case 't': /* store dlc ASCII value and terminate SFF CAN ID string */ cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN]; sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN] = 0; /* point to payload data behind the dlc */ cmd += SLC_CMD_LEN + SLC_SFF_ID_LEN + 1; break; case 'R': cf.can_id = CAN_RTR_FLAG; /* fallthrough */ case 'T': cf.can_id |= CAN_EFF_FLAG; /* store dlc ASCII value and terminate EFF CAN ID string */ cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN]; sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN] = 0; /* point to payload data behind the dlc */ cmd += SLC_CMD_LEN + SLC_EFF_ID_LEN + 1; break; default: return; } if (kstrtou32(sl->rbuff + SLC_CMD_LEN, 16, &tmpid)) return; cf.can_id |= tmpid; /* get can_dlc from sanitized ASCII value */ if (cf.can_dlc >= '0' && cf.can_dlc < '9') cf.can_dlc -= '0'; else return; *(u64 *) (&cf.data) = 0; /* clear payload */ /* RTR frames may have a dlc > 0 but they never have any data bytes */ if (!(cf.can_id & CAN_RTR_FLAG)) { for (i = 0; i < cf.can_dlc; i++) { tmp = hex_to_bin(*cmd++); if (tmp < 0) return; cf.data[i] = (tmp << 4); tmp = hex_to_bin(*cmd++); if (tmp < 0) return; cf.data[i] |= tmp; } } skb = dev_alloc_skb(sizeof(struct can_frame) + sizeof(struct can_skb_priv)); if (!skb) return; skb->dev = sl->dev; skb->protocol = htons(ETH_P_CAN); skb->pkt_type = PACKET_BROADCAST; skb->ip_summed = CHECKSUM_UNNECESSARY; can_skb_reserve(skb); can_skb_prv(skb)->ifindex = sl->dev->ifindex; can_skb_prv(skb)->skbcnt = 0; skb_put_data(skb, &cf, sizeof(struct can_frame)); sl->dev->stats.rx_packets++; sl->dev->stats.rx_bytes += cf.can_dlc; netif_rx_ni(skb); }
417
True
1
CVE-2020-11494
False
False
False
False
AV:L/AC:L/Au:N/C:P/I:N/A:N
LOCAL
LOW
NONE
PARTIAL
NONE
NONE
2.1
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
LOCAL
LOW
HIGH
NONE
UNCHANGED
HIGH
NONE
NONE
4.4
MEDIUM
0.8
3.6
False
[{'url': 'https://github.com/torvalds/linux/commit/b9258a2cece4ec1f020715fe3554bc2e360f6264', 'name': 'https://github.com/torvalds/linux/commit/b9258a2cece4ec1f020715fe3554bc2e360f6264', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00035.html', 'name': 'openSUSE-SU-2020:0543', 'refsource': 'SUSE', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'name': 'https://security.netapp.com/advisory/ntap-20200430-0004/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4364-1/', 'name': 'USN-4364-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4368-1/', 'name': 'USN-4368-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4363-1/', 'name': 'USN-4363-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4369-1/', 'name': 'USN-4369-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'http://packetstormsecurity.com/files/159565/Kernel-Live-Patch-Security-Notice-LSN-0072-1.html', 'name': 'http://packetstormsecurity.com/files/159565/Kernel-Live-Patch-Security-Notice-LSN-0072-1.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=08fadc32ce6239dc75fd5e869590e29bc62bbc28', 'name': 'https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=08fadc32ce6239dc75fd5e869590e29bc62bbc28', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Vendor Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}, {'lang': 'en', 'value': 'CWE-909'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.16', 'versionEndIncluding': '5.6.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in slc_bump in drivers/net/can/slcan.c in the Linux kernel 3.16 through 5.6.2. It allows attackers to read uninitialized can_frame data, potentially containing sensitive information from kernel stack memory, if the configuration lacks CONFIG_INIT_STACK_ALL, aka CID-b9258a2cece4.'}]
2022-04-29T13:26Z
2020-04-02T21:15Z
Missing Initialization of Resource
The software does not initialize a critical resource.
Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.
https://cwe.mitre.org/data/definitions/909.html
0
Richard Palethorpe
2020-04-01 12:06:39+02:00
slcan: Don't transmit uninitialized stack data in padding struct can_frame contains some padding which is not explicitly zeroed in slc_bump. This uninitialized data will then be transmitted if the stack initialization hardening feature is not enabled (CONFIG_INIT_STACK_ALL). This commit just zeroes the whole struct including the padding. Signed-off-by: Richard Palethorpe <[email protected]> Fixes: a1044e36e457 ("can: add slcan driver for serial/USB-serial CAN adapters") Reviewed-by: Kees Cook <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Marc Kleine-Budde <[email protected]> Signed-off-by: David S. Miller <[email protected]>
b9258a2cece4ec1f020715fe3554bc2e360f6264
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
slc_bump
slc_bump( struct slcan * sl)
['sl']
static void slc_bump(struct slcan *sl) { struct sk_buff *skb; struct can_frame cf; int i, tmp; u32 tmpid; char *cmd = sl->rbuff; cf.can_id = 0; switch (*cmd) { case 'r': cf.can_id = CAN_RTR_FLAG; /* fallthrough */ case 't': /* store dlc ASCII value and terminate SFF CAN ID string */ cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN]; sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN] = 0; /* point to payload data behind the dlc */ cmd += SLC_CMD_LEN + SLC_SFF_ID_LEN + 1; break; case 'R': cf.can_id = CAN_RTR_FLAG; /* fallthrough */ case 'T': cf.can_id |= CAN_EFF_FLAG; /* store dlc ASCII value and terminate EFF CAN ID string */ cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN]; sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN] = 0; /* point to payload data behind the dlc */ cmd += SLC_CMD_LEN + SLC_EFF_ID_LEN + 1; break; default: return; } if (kstrtou32(sl->rbuff + SLC_CMD_LEN, 16, &tmpid)) return; cf.can_id |= tmpid; /* get can_dlc from sanitized ASCII value */ if (cf.can_dlc >= '0' && cf.can_dlc < '9') cf.can_dlc -= '0'; else return; *(u64 *) (&cf.data) = 0; /* clear payload */ /* RTR frames may have a dlc > 0 but they never have any data bytes */ if (!(cf.can_id & CAN_RTR_FLAG)) { for (i = 0; i < cf.can_dlc; i++) { tmp = hex_to_bin(*cmd++); if (tmp < 0) return; cf.data[i] = (tmp << 4); tmp = hex_to_bin(*cmd++); if (tmp < 0) return; cf.data[i] |= tmp; } } skb = dev_alloc_skb(sizeof(struct can_frame) + sizeof(struct can_skb_priv)); if (!skb) return; skb->dev = sl->dev; skb->protocol = htons(ETH_P_CAN); skb->pkt_type = PACKET_BROADCAST; skb->ip_summed = CHECKSUM_UNNECESSARY; can_skb_reserve(skb); can_skb_prv(skb)->ifindex = sl->dev->ifindex; can_skb_prv(skb)->skbcnt = 0; skb_put_data(skb, &cf, sizeof(struct can_frame)); sl->dev->stats.rx_packets++; sl->dev->stats.rx_bytes += cf.can_dlc; netif_rx_ni(skb); }
417
True
1
CVE-2020-11565
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:P/A:P
LOCAL
LOW
NONE
NONE
PARTIAL
PARTIAL
3.6
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H
LOCAL
LOW
HIGH
NONE
UNCHANGED
NONE
HIGH
HIGH
6.0
MEDIUM
0.8
5.2
False
[{'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=aa9f7d5172fac9bf1f09e678c35e287a40a7b7dd', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=aa9f7d5172fac9bf1f09e678c35e287a40a7b7dd', 'refsource': 'MISC', 'tags': ['Mailing List', 'Patch', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/aa9f7d5172fac9bf1f09e678c35e287a40a7b7dd', 'name': 'https://github.com/torvalds/linux/commit/aa9f7d5172fac9bf1f09e678c35e287a40a7b7dd', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4667', 'name': 'DSA-4667', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4364-1/', 'name': 'USN-4364-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4367-1/', 'name': 'USN-4367-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4368-1/', 'name': 'USN-4368-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4363-1/', 'name': 'USN-4363-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4369-1/', 'name': 'USN-4369-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndIncluding': '5.6.2', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:esm:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': '** DISPUTED ** An issue was discovered in the Linux kernel through 5.6.2. mpol_parse_str in mm/mempolicy.c has a stack-based out-of-bounds write because an empty nodelist is mishandled during mount option parsing, aka CID-aa9f7d5172fa. NOTE: Someone in the security community disagrees that this is a vulnerability because the issue “is a bug in parsing mount options which can only be specified by a privileged user, so triggering the bug does not grant any powers not already held.”.'}]
2020-06-10T20:15Z
2020-04-06T01:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Randy Dunlap
2020-04-01 21:10:58-07:00
mm: mempolicy: require at least one nodeid for MPOL_PREFERRED Using an empty (malformed) nodelist that is not caught during mount option parsing leads to a stack-out-of-bounds access. The option string that was used was: "mpol=prefer:,". However, MPOL_PREFERRED requires a single node number, which is not being provided here. Add a check that 'nodes' is not empty after parsing for MPOL_PREFERRED's nodeid. Fixes: 095f1fc4ebf3 ("mempolicy: rework shmem mpol parsing and display") Reported-by: Entropy Moe <[email protected]> Reported-by: [email protected] Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: [email protected] Cc: Lee Schermerhorn <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
aa9f7d5172fac9bf1f09e678c35e287a40a7b7dd
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
mpol_parse_str
mpol_parse_str( char * str , struct mempolicy ** mpol)
['str', 'mpol']
int mpol_parse_str(char *str, struct mempolicy **mpol) { struct mempolicy *new = NULL; unsigned short mode_flags; nodemask_t nodes; char *nodelist = strchr(str, ':'); char *flags = strchr(str, '='); int err = 1, mode; if (flags) *flags++ = '\0'; /* terminate mode string */ if (nodelist) { /* NUL-terminate mode or flags string */ *nodelist++ = '\0'; if (nodelist_parse(nodelist, nodes)) goto out; if (!nodes_subset(nodes, node_states[N_MEMORY])) goto out; } else nodes_clear(nodes); mode = match_string(policy_modes, MPOL_MAX, str); if (mode < 0) goto out; switch (mode) { case MPOL_PREFERRED: /* * Insist on a nodelist of one node only */ if (nodelist) { char *rest = nodelist; while (isdigit(*rest)) rest++; if (*rest) goto out; } break; case MPOL_INTERLEAVE: /* * Default to online nodes with memory if no nodelist */ if (!nodelist) nodes = node_states[N_MEMORY]; break; case MPOL_LOCAL: /* * Don't allow a nodelist; mpol_new() checks flags */ if (nodelist) goto out; mode = MPOL_PREFERRED; break; case MPOL_DEFAULT: /* * Insist on a empty nodelist */ if (!nodelist) err = 0; goto out; case MPOL_BIND: /* * Insist on a nodelist */ if (!nodelist) goto out; } mode_flags = 0; if (flags) { /* * Currently, we only support two mutually exclusive * mode flags. */ if (!strcmp(flags, "static")) mode_flags |= MPOL_F_STATIC_NODES; else if (!strcmp(flags, "relative")) mode_flags |= MPOL_F_RELATIVE_NODES; else goto out; } new = mpol_new(mode, mode_flags, &nodes); if (IS_ERR(new)) goto out; /* * Save nodes for mpol_to_str() to show the tmpfs mount options * for /proc/mounts, /proc/pid/mounts and /proc/pid/mountinfo. */ if (mode != MPOL_PREFERRED) new->v.nodes = nodes; else if (nodelist) new->v.preferred_node = first_node(nodes); else new->flags |= MPOL_F_LOCAL; /* * Save nodes for contextualization: this will be used to "clone" * the mempolicy in a specific context [cpuset] at a later time. */ new->w.user_nodemask = nodes; err = 0; out: /* Restore string for error message */ if (nodelist) *--nodelist = ':'; if (flags) *--flags = '='; if (!err) *mpol = new; return err; }
382
True
1
CVE-2020-12659
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
6.7
MEDIUM
0.8
5.9
False
[{'url': 'https://bugzilla.kernel.org/show_bug.cgi?id=207225', 'name': 'https://bugzilla.kernel.org/show_bug.cgi?id=207225', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.7', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.7', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/99e3a236dd43d06c65af0a2ef9cb44306aef6e02', 'name': 'https://github.com/torvalds/linux/commit/99e3a236dd43d06c65af0a2ef9cb44306aef6e02', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=99e3a236dd43d06c65af0a2ef9cb44306aef6e02', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=99e3a236dd43d06c65af0a2ef9cb44306aef6e02', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4388-1/', 'name': 'USN-4388-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4389-1/', 'name': 'USN-4389-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4387-1/', 'name': 'USN-4387-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.6.7', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in the Linux kernel before 5.6.7. xdp_umem_reg in net/xdp/xdp_umem.c has an out-of-bounds write (by a user with the CAP_NET_ADMIN capability) because of a lack of headroom validation.'}]
2020-06-17T18:15Z
2020-05-05T07:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Magnus Karlsson
2020-04-14 09:35:15+02:00
xsk: Add missing check on user supplied headroom size Add a check that the headroom cannot be larger than the available space in the chunk. In the current code, a malicious user can set the headroom to a value larger than the chunk size minus the fixed XDP headroom. That way packets with a length larger than the supported size in the umem could get accepted and result in an out-of-bounds write. Fixes: c0c77d8fb787 ("xsk: add user memory registration support sockopt") Reported-by: Bui Quang Minh <[email protected]> Signed-off-by: Magnus Karlsson <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=207225 Link: https://lore.kernel.org/bpf/[email protected]
99e3a236dd43d06c65af0a2ef9cb44306aef6e02
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
xdp_umem_reg
xdp_umem_reg( struct xdp_umem * umem , struct xdp_umem_reg * mr)
['umem', 'mr']
static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) { bool unaligned_chunks = mr->flags & XDP_UMEM_UNALIGNED_CHUNK_FLAG; u32 chunk_size = mr->chunk_size, headroom = mr->headroom; unsigned int chunks, chunks_per_page; u64 addr = mr->addr, size = mr->len; int size_chk, err; if (chunk_size < XDP_UMEM_MIN_CHUNK_SIZE || chunk_size > PAGE_SIZE) { /* Strictly speaking we could support this, if: * - huge pages, or* * - using an IOMMU, or * - making sure the memory area is consecutive * but for now, we simply say "computer says no". */ return -EINVAL; } if (mr->flags & ~(XDP_UMEM_UNALIGNED_CHUNK_FLAG | XDP_UMEM_USES_NEED_WAKEUP)) return -EINVAL; if (!unaligned_chunks && !is_power_of_2(chunk_size)) return -EINVAL; if (!PAGE_ALIGNED(addr)) { /* Memory area has to be page size aligned. For * simplicity, this might change. */ return -EINVAL; } if ((addr + size) < addr) return -EINVAL; chunks = (unsigned int)div_u64(size, chunk_size); if (chunks == 0) return -EINVAL; if (!unaligned_chunks) { chunks_per_page = PAGE_SIZE / chunk_size; if (chunks < chunks_per_page || chunks % chunks_per_page) return -EINVAL; } size_chk = chunk_size - headroom - XDP_PACKET_HEADROOM; if (size_chk < 0) return -EINVAL; umem->address = (unsigned long)addr; umem->chunk_mask = unaligned_chunks ? XSK_UNALIGNED_BUF_ADDR_MASK : ~((u64)chunk_size - 1); umem->size = size; umem->headroom = headroom; umem->chunk_size_nohr = chunk_size - headroom; umem->npgs = size / PAGE_SIZE; umem->pgs = NULL; umem->user = NULL; umem->flags = mr->flags; INIT_LIST_HEAD(&umem->xsk_list); spin_lock_init(&umem->xsk_list_lock); refcount_set(&umem->users, 1); err = xdp_umem_account_pages(umem); if (err) return err; err = xdp_umem_pin_pages(umem); if (err) goto out_account; umem->pages = kvcalloc(umem->npgs, sizeof(*umem->pages), GFP_KERNEL_ACCOUNT); if (!umem->pages) { err = -ENOMEM; goto out_pin; } err = xdp_umem_map_pages(umem); if (!err) return 0; kvfree(umem->pages); out_pin: xdp_umem_unpin_pages(umem); out_account: xdp_umem_unaccount_pages(umem); return err; }
409
True
1
CVE-2020-12464
False
False
False
False
AV:L/AC:L/Au:N/C:C/I:C/A:C
LOCAL
LOW
NONE
COMPLETE
COMPLETE
COMPLETE
7.2
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
LOCAL
LOW
HIGH
NONE
UNCHANGED
HIGH
HIGH
HIGH
6.7
MEDIUM
0.8
5.9
False
[{'url': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=056ad39ee9253873522f6469c3364964a322912b', 'name': 'https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=056ad39ee9253873522f6469c3364964a322912b', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.8', 'name': 'https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.8', 'refsource': 'MISC', 'tags': ['Release Notes', 'Vendor Advisory']}, {'url': 'https://patchwork.kernel.org/patch/11463781/', 'name': 'https://patchwork.kernel.org/patch/11463781/', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lkml.org/lkml/2020/3/23/52', 'name': 'https://lkml.org/lkml/2020/3/23/52', 'refsource': 'MISC', 'tags': ['Exploit', 'Vendor Advisory']}, {'url': 'https://github.com/torvalds/linux/commit/056ad39ee9253873522f6469c3364964a322912b', 'name': 'https://github.com/torvalds/linux/commit/056ad39ee9253873522f6469c3364964a322912b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200608-0001/', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00011.html', 'name': '[debian-lts-announce] 20200609 [SECURITY] [DLA 2241-1] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00013.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2241-2] linux security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/06/msg00012.html', 'name': '[debian-lts-announce] 20200610 [SECURITY] [DLA 2242-1] linux-4.9 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4698', 'name': 'DSA-4698', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://www.debian.org/security/2020/dsa-4699', 'name': 'DSA-4699', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-06/msg00022.html', 'name': 'openSUSE-SU-2020:0801', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4388-1/', 'name': 'USN-4388-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4389-1/', 'name': 'USN-4389-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4387-1/', 'name': 'USN-4387-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4390-1/', 'name': 'USN-4390-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://usn.ubuntu.com/4391-1/', 'name': 'USN-4391-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.6.8', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'usb_sg_cancel in drivers/usb/core/message.c in the Linux kernel before 5.6.8 has a use-after-free because a transfer occurs without a reference, aka CID-056ad39ee925.'}]
2020-06-22T22:15Z
2020-04-29T18:15Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. 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. 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.
https://cwe.mitre.org/data/definitions/416.html
0
Alan Stern
2020-03-28 16:18:11-04:00
USB: core: Fix free-while-in-use bug in the USB S-Glibrary FuzzUSB (a variant of syzkaller) found a free-while-still-in-use bug in the USB scatter-gather library: BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline] BUG: KASAN: use-after-free in usb_hcd_unlink_urb+0x5f/0x170 drivers/usb/core/hcd.c:1607 Read of size 4 at addr ffff888065379610 by task kworker/u4:1/27 CPU: 1 PID: 27 Comm: kworker/u4:1 Not tainted 5.5.11 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 Workqueue: scsi_tmf_2 scmd_eh_abort_handler Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0xce/0x128 lib/dump_stack.c:118 print_address_description.constprop.4+0x21/0x3c0 mm/kasan/report.c:374 __kasan_report+0x153/0x1cb mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x152/0x1b0 mm/kasan/generic.c:192 __kasan_check_read+0x11/0x20 mm/kasan/common.c:95 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline] usb_hcd_unlink_urb+0x5f/0x170 drivers/usb/core/hcd.c:1607 usb_unlink_urb+0x72/0xb0 drivers/usb/core/urb.c:657 usb_sg_cancel+0x14e/0x290 drivers/usb/core/message.c:602 usb_stor_stop_transport+0x5e/0xa0 drivers/usb/storage/transport.c:937 This bug occurs when cancellation of the S-G transfer races with transfer completion. When that happens, usb_sg_cancel() may continue to access the transfer's URBs after usb_sg_wait() has freed them. The bug is caused by the fact that usb_sg_cancel() does not take any sort of reference to the transfer, and so there is nothing to prevent the URBs from being deallocated while the routine is trying to use them. The fix is to take such a reference by incrementing the transfer's io->count field while the cancellation is in progres and decrementing it afterward. The transfer's URBs are not deallocated until io->complete is triggered, which happens when io->count reaches zero. Signed-off-by: Alan Stern <[email protected]> Reported-and-tested-by: Kyungtae Kim <[email protected]> CC: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
056ad39ee9253873522f6469c3364964a322912b
False
torvalds/linux
Linux kernel source tree
2011-09-04 22:48:12
2022-08-26 19:08:15
torvalds
136917.0
44307.0
usb_sg_cancel
usb_sg_cancel( struct usb_sg_request * io)
['io']
void usb_sg_cancel(struct usb_sg_request *io) { unsigned long flags; int i, retval; spin_lock_irqsave(&io->lock, flags); if (io->status) { spin_unlock_irqrestore(&io->lock, flags); return; } /* shut everything down */ io->status = -ECONNRESET; spin_unlock_irqrestore(&io->lock, flags); for (i = io->entries - 1; i >= 0; --i) { usb_block_urb(io->urbs[i]); retval = usb_unlink_urb(io->urbs[i]); if (retval != -EINPROGRESS && retval != -ENODEV && retval != -EBUSY && retval != -EIDRM) dev_warn(&io->dev->dev, "%s, unlink --> %d\n", __func__, retval); } }
144
True
1
CVE-2009-1194
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.ocert.org/advisories/ocert-2009-001.html', 'name': 'http://www.ocert.org/advisories/ocert-2009-001.html', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=496887', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=496887', 'refsource': 'CONFIRM', 'tags': ['Exploit']}, {'url': 'http://www.openwall.com/lists/oss-security/2009/05/07/1', 'name': '[oss-security] 20090507 [oCERT-2009-001] Pango integer overflow in heap allocation size calculations', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.ubuntu.com/usn/USN-773-1', 'name': 'USN-773-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://launchpad.net/bugs/cve/2009-1194', 'name': 'https://launchpad.net/bugs/cve/2009-1194', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://bugzilla.mozilla.org/show_bug.cgi?id=480134', 'name': 'https://bugzilla.mozilla.org/show_bug.cgi?id=480134', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://github.com/bratsche/pango/commit/4de30e5500eaeb49f4bf0b7a07f718e149a2ed5e', 'name': 'http://github.com/bratsche/pango/commit/4de30e5500eaeb49f4bf0b7a07f718e149a2ed5e', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.debian.org/security/2009/dsa-1798', 'name': 'DSA-1798', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://www.redhat.com/support/errata/RHSA-2009-0476.html', 'name': 'RHSA-2009:0476', 'refsource': 'REDHAT', 'tags': []}, {'url': 'http://secunia.com/advisories/35021', 'name': '35021', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/34870', 'name': '34870', 'refsource': 'BID', 'tags': []}, {'url': 'http://secunia.com/advisories/35018', 'name': '35018', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://secunia.com/advisories/35027', 'name': '35027', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.securitytracker.com/id?1022196', 'name': '1022196', 'refsource': 'SECTRACK', 'tags': []}, {'url': 'http://osvdb.org/54279', 'name': '54279', 'refsource': 'OSVDB', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2009/1269', 'name': 'ADV-2009-1269', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://secunia.com/advisories/35038', 'name': '35038', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2009-07/msg00002.html', 'name': 'SUSE-SR:2009:012', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://secunia.com/advisories/35685', 'name': '35685', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/35758', 'name': '35758', 'refsource': 'BID', 'tags': []}, {'url': 'http://www.mozilla.org/security/announce/2009/mfsa2009-36.html', 'name': 'http://www.mozilla.org/security/announce/2009/mfsa2009-36.html', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2009/1972', 'name': 'ADV-2009-1972', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://secunia.com/advisories/35914', 'name': '35914', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2009-08/msg00002.html', 'name': 'SUSE-SA:2009:042', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://secunia.com/advisories/36145', 'name': '36145', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://sunsolve.sun.com/search/document.do?assetkey=1-66-264308-1', 'name': '264308', 'refsource': 'SUNALERT', 'tags': []}, {'url': 'http://secunia.com/advisories/36005', 'name': '36005', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2009-07/msg00005.html', 'name': 'SUSE-SA:2009:039', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/50397', 'name': 'pango-pangoglyphstringsetsize-bo(50397)', 'refsource': 'XF', 'tags': []}, {'url': 'https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10137', 'name': 'oval:org.mitre.oval:def:10137', 'refsource': 'OVAL', 'tags': []}, {'url': 'http://www.securityfocus.com/archive/1/503349/100/0/threaded', 'name': '20090507 [oCERT-2009-001] Pango integer overflow in heap allocation size calculations', 'refsource': 'BUGTRAQ', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-189'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.16:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.22', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.18:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pango:pango:1.20:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Integer overflow in the pango_glyph_string_set_size function in pango/glyphstring.c in Pango before 1.24 allows context-dependent attackers to cause a denial of service (application crash) or possibly execute arbitrary code via a long glyph string that triggers a heap-based buffer overflow, as demonstrated by a long document.location value in Firefox.'}]
2018-10-10T19:34Z
2009-05-11T15:30Z
Numeric Errors
Weaknesses in this category are related to improper calculation or conversion of numbers.
https://cwe.mitre.org/data/definitions/189.html
1
Behdad Esfahbod
2009-03-02 11:48:52+03:18
[glyphstring] Handle overflow with very long glyphstrings
4de30e5500eaeb49f4bf0b7a07f718e149a2ed5e
False
bratsche/pango
Library for laying out and rendering of text, with an emphasis on internationalization.
2009-04-01 18:19:24
2009-04-18 19:38:15
http://www.pango.org/
bratsche
10.0
3.0
pango_glyph_string_set_size
pango_glyph_string_set_size( PangoGlyphString * string , gint new_len)
['string', 'new_len']
pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) { g_return_if_fail (new_len >= 0); while (new_len > string->space) { if (string->space == 0) string->space = 1; else string->space *= 2; if (string->space < 0) { g_warning ("glyph string length overflows maximum integer size, truncated"); new_len = string->space = G_MAXINT - 8; } } string->glyphs = g_realloc (string->glyphs, string->space * sizeof (PangoGlyphInfo)); string->log_clusters = g_realloc (string->log_clusters, string->space * sizeof (gint)); string->num_glyphs = new_len; }
121
True
1
CVE-2011-4966
False
False
False
False
AV:N/AC:M/Au:S/C:P/I:P/A:P
NETWORK
MEDIUM
SINGLE
PARTIAL
PARTIAL
PARTIAL
6.0
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://rhn.redhat.com/errata/RHBA-2012-0881.html', 'name': 'http://rhn.redhat.com/errata/RHBA-2012-0881.html', 'refsource': 'MISC', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-updates/2013-01/msg00079.html', 'name': 'openSUSE-SU-2013:0191', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-updates/2013-01/msg00029.html', 'name': 'openSUSE-SU-2013:0137', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://rhn.redhat.com/errata/RHSA-2013-0134.html', 'name': 'RHSA-2013:0134', 'refsource': 'REDHAT', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://github.com/alandekok/freeradius-server/commit/1b1ec5ce75e224bd1755650c18ccdaa6dc53e605', 'name': 'https://github.com/alandekok/freeradius-server/commit/1b1ec5ce75e224bd1755650c18ccdaa6dc53e605', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-255'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.0.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.0.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:*:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.8.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.0.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.9.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.0.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.2.0', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.9.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.0.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.7.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:1.1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:0.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:freeradius:freeradius:2.1.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'modules/rlm_unix/rlm_unix.c in FreeRADIUS before 2.2.0, when unix mode is enabled for user authentication, does not properly check the password expiration in /etc/shadow, which allows remote authenticated users to authenticate using an expired password.'}]
2013-03-19T12:35Z
2013-03-12T23:55Z
Credentials Management Errors
Weaknesses in this category are related to the management of credentials.
https://cwe.mitre.org/data/definitions/255.html
1
Alan T. DeKok
2012-02-07 20:58:52+01:00
heck for account and password expiration
1b1ec5ce75e224bd1755650c18ccdaa6dc53e605
False
alandekok/freeradius-server
Alan DeKok's private copy of the FreeRADIUS Server code. Do NOT fork this. Use the link below instead.
2012-09-27 13:04:58
2022-08-25 10:12:36
https://github.com/FreeRADIUS/freeradius-server
alandekok
8.0
15.0
unix_getpw
unix_getpw( UNUSED void * instance , REQUEST * request , VALUE_PAIR ** vp_list)
['instance', 'request', 'vp_list']
static int unix_getpw(UNUSED void *instance, REQUEST *request, VALUE_PAIR **vp_list) { const char *name; const char *encrypted_pass; #ifdef HAVE_GETSPNAM struct spwd *spwd = NULL; #endif #ifdef OSFC2 struct pr_passwd *pr_pw; #else struct passwd *pwd; #endif #ifdef HAVE_GETUSERSHELL char *shell; #endif VALUE_PAIR *vp; /* * We can only authenticate user requests which HAVE * a User-Name attribute. */ if (!request->username) { return RLM_MODULE_NOOP; } name = (char *)request->username->vp_strvalue; encrypted_pass = NULL; #ifdef OSFC2 if ((pr_pw = getprpwnam(name)) == NULL) return RLM_MODULE_NOTFOUND; encrypted_pass = pr_pw->ufld.fd_encrypt; /* * Check if account is locked. */ if (pr_pw->uflg.fg_lock!=1) { radlog(L_AUTH, "rlm_unix: [%s]: account locked", name); return RLM_MODULE_USERLOCK; } #else /* OSFC2 */ if ((pwd = getpwnam(name)) == NULL) { return RLM_MODULE_NOTFOUND; } encrypted_pass = pwd->pw_passwd; #endif /* OSFC2 */ #ifdef HAVE_GETSPNAM /* * See if there is a shadow password. * * Only query the _system_ shadow file if the encrypted * password from the passwd file is < 10 characters (i.e. * a valid password would never crypt() to it). This will * prevents users from using NULL password fields as things * stand right now. */ if ((encrypted_pass == NULL) || (strlen(encrypted_pass) < 10)) { if ((spwd = getspnam(name)) == NULL) { return RLM_MODULE_NOTFOUND; } encrypted_pass = spwd->sp_pwdp; } #endif /* HAVE_GETSPNAM */ /* * These require 'pwd != NULL', which isn't true on OSFC2 */ #ifndef OSFC2 #ifdef DENY_SHELL /* * Users with a particular shell are denied access */ if (strcmp(pwd->pw_shell, DENY_SHELL) == 0) { radlog_request(L_AUTH, 0, request, "rlm_unix: [%s]: invalid shell", name); return RLM_MODULE_REJECT; } #endif #ifdef HAVE_GETUSERSHELL /* * Check /etc/shells for a valid shell. If that file * contains /RADIUSD/ANY/SHELL then any shell will do. */ while ((shell = getusershell()) != NULL) { if (strcmp(shell, pwd->pw_shell) == 0 || strcmp(shell, "/RADIUSD/ANY/SHELL") == 0) { break; } } endusershell(); if (shell == NULL) { radlog_request(L_AUTH, 0, request, "[%s]: invalid shell [%s]", name, pwd->pw_shell); return RLM_MODULE_REJECT; } #endif #endif /* OSFC2 */ #if defined(HAVE_GETSPNAM) && !defined(M_UNIX) /* * Check if password has expired. */ if (spwd && spwd->sp_expire > 0 && (request->timestamp / 86400) > spwd->sp_expire) { radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name); return RLM_MODULE_REJECT; } #endif #if defined(__FreeBSD__) || defined(bsdi) || defined(_PWF_EXPIRE) /* * Check if password has expired. */ if ((pwd->pw_expire > 0) && (request->timestamp > pwd->pw_expire)) { radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name); return RLM_MODULE_REJECT; } #endif /* * We might have a passwordless account. * * FIXME: Maybe add Auth-Type := Accept? */ if (encrypted_pass[0] == 0) return RLM_MODULE_NOOP; vp = pairmake("Crypt-Password", encrypted_pass, T_OP_SET); if (!vp) return RLM_MODULE_FAIL; pairmove(vp_list, &vp); pairfree(&vp); /* might not be NULL; */ return RLM_MODULE_UPDATED; }
424
True
1
CVE-2009-3627
False
False
False
False
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6225', 'name': 'https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6225', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.openwall.com/lists/oss-security/2009/10/23/9', 'name': '[oss-security] 20091023 CVE-2009-3627 assignment notification - HTML-Parser-3.63', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/37155', 'name': '37155', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://www.securityfocus.com/bid/36807', 'name': '36807', 'refsource': 'BID', 'tags': ['Patch']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=530604', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=530604', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2009/3022', 'name': 'ADV-2009-3022', 'refsource': 'VUPEN', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://github.com/gisle/html-parser/commit/b9aae1e43eb2c8e989510187cff0ba3e996f9a4c', 'name': 'http://github.com/gisle/html-parser/commit/b9aae1e43eb2c8e989510187cff0ba3e996f9a4c', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/53941', 'name': 'htmlparser-decodeentities-dos(53941)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:*:*:*:*:*:*:*:*', 'versionEndIncluding': '3.54', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.42:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.41:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.00:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:derrick_oswald:html-parser:1.4:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The decode_entities function in util.c in HTML-Parser before 3.63 allows context-dependent attackers to cause a denial of service (infinite loop) via an incomplete SGML numeric character reference, which triggers generation of an invalid UTF-8 character.'}]
2017-08-17T01:31Z
2009-10-29T14:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Gisle Aas
2009-10-22 21:45:54+02:00
decode_entities confused by trailing incomplete entity Mark Martinec reported crashed when running SpamAssassin, given a particular HTML junk mail to parse. The problem was caused by HTML::Parsers decode_entities function confusing itself when it encountered strings with incomplete entities at the end of the string.
b9aae1e43eb2c8e989510187cff0ba3e996f9a4c
False
gisle/html-parser
The HTML-Parser distribution is is a collection of modules that parse and extract information from HTML documents
2008-11-17 12:35:00
2020-08-24 16:39:40
http://search.cpan.org/dist/HTML-Parser/
gisle
19.0
15.0
decode_entities
decode_entities( pTHX_ SV * sv , HV * entity2char , bool expand_prefix)
['sv', 'entity2char', 'expand_prefix']
decode_entities(pTHX_ SV* sv, HV* entity2char, bool expand_prefix) { STRLEN len; char *s = SvPV_force(sv, len); char *t = s; char *end = s + len; char *ent_start; char *repl; STRLEN repl_len; #ifdef UNICODE_HTML_PARSER char buf[UTF8_MAXLEN]; int repl_utf8; int high_surrogate = 0; #else char buf[1]; #endif #if defined(__GNUC__) && defined(UNICODE_HTML_PARSER) /* gcc -Wall reports this variable as possibly used uninitialized */ repl_utf8 = 0; #endif while (s < end) { assert(t <= s); if ((*t++ = *s++) != '&') continue; ent_start = s; repl = 0; if (*s == '#') { UV num = 0; UV prev = 0; int ok = 0; s++; if (*s == 'x' || *s == 'X') { s++; while (*s) { char *tmp = strchr(PL_hexdigit, *s); if (!tmp) break; num = num << 4 | ((tmp - PL_hexdigit) & 15); if (prev && num <= prev) { /* overflow */ ok = 0; break; } prev = num; s++; ok = 1; } } else { while (isDIGIT(*s)) { num = num * 10 + (*s - '0'); if (prev && num < prev) { /* overflow */ ok = 0; break; } prev = num; s++; ok = 1; } } if (ok) { #ifdef UNICODE_HTML_PARSER if (!SvUTF8(sv) && num <= 255) { buf[0] = (char) num; repl = buf; repl_len = 1; repl_utf8 = 0; } else { char *tmp; if ((num & 0xFFFFFC00) == 0xDC00) { /* low-surrogate */ if (high_surrogate != 0) { t -= 3; /* Back up past 0xFFFD */ num = ((high_surrogate - 0xD800) << 10) + (num - 0xDC00) + 0x10000; high_surrogate = 0; } else { num = 0xFFFD; } } else if ((num & 0xFFFFFC00) == 0xD800) { /* high-surrogate */ high_surrogate = num; num = 0xFFFD; } else { high_surrogate = 0; /* otherwise invalid? */ if ((num >= 0xFDD0 && num <= 0xFDEF) || ((num & 0xFFFE) == 0xFFFE) || num > 0x10FFFF) { num = 0xFFFD; } } tmp = (char*)uvuni_to_utf8((U8*)buf, num); repl = buf; repl_len = tmp - buf; repl_utf8 = 1; } #else if (num <= 255) { buf[0] = (char) num & 0xFF; repl = buf; repl_len = 1; } #endif } } else { char *ent_name = s; while (isALNUM(*s)) s++; if (ent_name != s && entity2char) { SV** svp; if ( (svp = hv_fetch(entity2char, ent_name, s - ent_name, 0)) || (*s == ';' && (svp = hv_fetch(entity2char, ent_name, s - ent_name + 1, 0))) ) { repl = SvPV(*svp, repl_len); #ifdef UNICODE_HTML_PARSER repl_utf8 = SvUTF8(*svp); #endif } else if (expand_prefix) { char *ss = s - 1; while (ss > ent_name) { svp = hv_fetch(entity2char, ent_name, ss - ent_name, 0); if (svp) { repl = SvPV(*svp, repl_len); #ifdef UNICODE_HTML_PARSER repl_utf8 = SvUTF8(*svp); #endif s = ss; break; } ss--; } } } #ifdef UNICODE_HTML_PARSER high_surrogate = 0; #endif } if (repl) { char *repl_allocated = 0; if (*s == ';') s++; t--; /* '&' already copied, undo it */ #ifdef UNICODE_HTML_PARSER if (*s != '&') { high_surrogate = 0; } if (!SvUTF8(sv) && repl_utf8) { /* need to upgrade sv before we continue */ STRLEN before_gap_len = t - SvPVX(sv); char *before_gap = (char*)bytes_to_utf8((U8*)SvPVX(sv), &before_gap_len); STRLEN after_gap_len = end - s; char *after_gap = (char*)bytes_to_utf8((U8*)s, &after_gap_len); sv_setpvn(sv, before_gap, before_gap_len); sv_catpvn(sv, after_gap, after_gap_len); SvUTF8_on(sv); Safefree(before_gap); Safefree(after_gap); s = t = SvPVX(sv) + before_gap_len; end = SvPVX(sv) + before_gap_len + after_gap_len; } else if (SvUTF8(sv) && !repl_utf8) { repl = (char*)bytes_to_utf8((U8*)repl, &repl_len); repl_allocated = repl; } #endif if (t + repl_len > s) { /* need to grow the string */ grow_gap(aTHX_ sv, repl_len - (s - t), &t, &s, &end); } /* copy replacement string into string */ while (repl_len--) *t++ = *repl++; if (repl_allocated) Safefree(repl_allocated); } else { while (ent_start < s) *t++ = *ent_start++; } } *t = '\0'; SvCUR_set(sv, t - SvPVX(sv)); return sv; }
975
True
1
CVE-2010-0011
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://lists.uzbl.org/pipermail/uzbl-dev-uzbl.org/2010-January/000586.html', 'name': '[uzbl-dev] 20100102 Fw: Uzbl: security issue', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://github.com/Dieterbe/uzbl/commit/1958b52d41cba96956dc1995660de49525ed1047', 'name': 'http://github.com/Dieterbe/uzbl/commit/1958b52d41cba96956dc1995660de49525ed1047', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.uzbl.org/news.php?id=22', 'name': 'http://www.uzbl.org/news.php?id=22', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.openwall.com/lists/oss-security/2010/01/06/3', 'name': '[oss-security] 20100106 Re: CVE request - uzbl remote code execution', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://github.com/Dieterbe/uzbl/downloads', 'name': 'http://github.com/Dieterbe/uzbl/downloads', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.openwall.com/lists/oss-security/2010/01/06/1', 'name': '[oss-security] 20100106 CVE request - uzbl remote code execution', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/56612', 'name': 'uzbl-evaljs-command-execution(56612)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-264'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:uzbl:uzbl:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2009.12.22', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The eval_js function in uzbl-core.c in Uzbl before 2010.01.05 exposes the run method of the Uzbl object, which allows remote attackers to execute arbitrary commands via JavaScript code.'}]
2017-08-17T01:31Z
2010-02-25T19:30Z
Permissions, Privileges, and Access Controls
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.
https://cwe.mitre.org/data/definitions/264.html
1
Dieter Plaetinck
2010-01-05 20:17:29+01:00
disable Uzbl javascript object because of security problem.
1958b52d41cba96956dc1995660de49525ed1047
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
Dieterbe
visit repo url
visit repo url
test_js
test_js( void)
['void']
test_js (void) { GString *result = g_string_new(""); /* simple javascript can be evaluated and returned */ parse_cmd_line("js ('x' + 345).toUpperCase()", result); g_assert_cmpstr("X345", ==, result->str); /* uzbl commands can be run from javascript */ uzbl.net.useragent = "Test useragent"; parse_cmd_line("js Uzbl.run('print @useragent').toUpperCase();", result); g_assert_cmpstr("TEST USERAGENT", ==, result->str); g_string_free(result, TRUE); }
66
True
1
CVE-2010-0011
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://lists.uzbl.org/pipermail/uzbl-dev-uzbl.org/2010-January/000586.html', 'name': '[uzbl-dev] 20100102 Fw: Uzbl: security issue', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://github.com/Dieterbe/uzbl/commit/1958b52d41cba96956dc1995660de49525ed1047', 'name': 'http://github.com/Dieterbe/uzbl/commit/1958b52d41cba96956dc1995660de49525ed1047', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.uzbl.org/news.php?id=22', 'name': 'http://www.uzbl.org/news.php?id=22', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.openwall.com/lists/oss-security/2010/01/06/3', 'name': '[oss-security] 20100106 Re: CVE request - uzbl remote code execution', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://github.com/Dieterbe/uzbl/downloads', 'name': 'http://github.com/Dieterbe/uzbl/downloads', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://www.openwall.com/lists/oss-security/2010/01/06/1', 'name': '[oss-security] 20100106 CVE request - uzbl remote code execution', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/56612', 'name': 'uzbl-evaljs-command-execution(56612)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-264'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:uzbl:uzbl:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2009.12.22', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The eval_js function in uzbl-core.c in Uzbl before 2010.01.05 exposes the run method of the Uzbl object, which allows remote attackers to execute arbitrary commands via JavaScript code.'}]
2017-08-17T01:31Z
2010-02-25T19:30Z
Permissions, Privileges, and Access Controls
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.
https://cwe.mitre.org/data/definitions/264.html
1
Dieter Plaetinck
2010-01-05 20:17:29+01:00
disable Uzbl javascript object because of security problem.
1958b52d41cba96956dc1995660de49525ed1047
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
Dieterbe
visit repo url
visit repo url
eval_js
eval_js( WebKitWebView * web_view , gchar * script , GString * result)
['web_view', 'script', 'result']
eval_js(WebKitWebView * web_view, gchar *script, GString *result) { WebKitWebFrame *frame; JSGlobalContextRef context; JSObjectRef globalobject; JSStringRef var_name; JSStringRef js_script; JSValueRef js_result; JSStringRef js_result_string; size_t js_result_size; js_init(); frame = webkit_web_view_get_main_frame(WEBKIT_WEB_VIEW(web_view)); context = webkit_web_frame_get_global_context(frame); globalobject = JSContextGetGlobalObject(context); /* uzbl javascript namespace */ var_name = JSStringCreateWithUTF8CString("Uzbl"); JSObjectSetProperty(context, globalobject, var_name, JSObjectMake(context, uzbl.js.classref, NULL), kJSClassAttributeNone, NULL); /* evaluate the script and get return value*/ js_script = JSStringCreateWithUTF8CString(script); js_result = JSEvaluateScript(context, js_script, globalobject, NULL, 0, NULL); if (js_result && !JSValueIsUndefined(context, js_result)) { js_result_string = JSValueToStringCopy(context, js_result, NULL); js_result_size = JSStringGetMaximumUTF8CStringSize(js_result_string); if (js_result_size) { char js_result_utf8[js_result_size]; JSStringGetUTF8CString(js_result_string, js_result_utf8, js_result_size); g_string_assign(result, js_result_utf8); } JSStringRelease(js_result_string); } /* cleanup */ JSObjectDeleteProperty(context, globalobject, var_name, NULL); JSStringRelease(var_name); JSStringRelease(js_script); }
212
True
1
CVE-2010-1152
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://github.com/memcached/memcached/commit/d9cd01ede97f4145af9781d448c62a3318952719', 'name': 'http://github.com/memcached/memcached/commit/d9cd01ede97f4145af9781d448c62a3318952719', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/39306', 'name': '39306', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://github.com/memcached/memcached/commit/75cc83685e103bc8ba380a57468c8f04413033f9', 'name': 'http://github.com/memcached/memcached/commit/75cc83685e103bc8ba380a57468c8f04413033f9', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127075808518733&w=2', 'name': '[oss-security] 20100408 Re: CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127075341110616&w=2', 'name': '[oss-security] 20100408 Re: CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127074597129559&w=2', 'name': '[oss-security] 20100408 CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://code.google.com/p/memcached/issues/detail?id=102', 'name': 'http://code.google.com/p/memcached/issues/detail?id=102', 'refsource': 'CONFIRM', 'tags': ['Exploit']}, {'url': 'http://securitytracker.com/id?1023839', 'name': '1023839', 'refsource': 'SECTRACK', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00002.html', 'name': 'SUSE-SR:2010:012', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-06/msg00001.html', 'name': 'SUSE-SR:2010:013', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2011/0442', 'name': 'ADV-2011-0442', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://blogs.sun.com/security/entry/input_validation_vulnerability_in_memcached', 'name': 'http://blogs.sun.com/security/entry/input_validation_vulnerability_in_memcached', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.1:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.4.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.1.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.1:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.2:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.1.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'memcached.c in memcached before 1.4.3 allows remote attackers to cause a denial of service (daemon hang or crash) via a long line that triggers excessive memory allocation. NOTE: some of these details are obtained from third party information.'}]
2011-03-01T07:01Z
2010-04-12T18:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Trond Norbye
2009-10-28 11:51:05+01:00
Issue 102: Piping null to the server will crash it
75cc83685e103bc8ba380a57468c8f04413033f9
False
memcached/memcached
memcached development tree
2009-04-24 23:34:25
2022-08-27 00:43:06
https://memcached.org
memcached
12057.0
3109.0
try_read_command
try_read_command( conn * c)
['c']
static int try_read_command(conn *c) { assert(c != NULL); assert(c->rcurr <= (c->rbuf + c->rsize)); assert(c->rbytes > 0); if (c->protocol == negotiating_prot || c->transport == udp_transport) { if ((unsigned char)c->rbuf[0] == (unsigned char)PROTOCOL_BINARY_REQ) { c->protocol = binary_prot; } else { c->protocol = ascii_prot; } if (settings.verbose > 1) { fprintf(stderr, "%d: Client using the %s protocol\n", c->sfd, prot_text(c->protocol)); } } if (c->protocol == binary_prot) { /* Do we have the complete packet header? */ if (c->rbytes < sizeof(c->binary_header)) { /* need more data! */ return 0; } else { #ifdef NEED_ALIGN if (((long)(c->rcurr)) % 8 != 0) { /* must realign input buffer */ memmove(c->rbuf, c->rcurr, c->rbytes); c->rcurr = c->rbuf; if (settings.verbose > 1) { fprintf(stderr, "%d: Realign input buffer\n", c->sfd); } } #endif protocol_binary_request_header* req; req = (protocol_binary_request_header*)c->rcurr; if (settings.verbose > 1) { /* Dump the packet before we convert it to host order */ int ii; fprintf(stderr, "<%d Read binary protocol data:", c->sfd); for (ii = 0; ii < sizeof(req->bytes); ++ii) { if (ii % 4 == 0) { fprintf(stderr, "\n<%d ", c->sfd); } fprintf(stderr, " 0x%02x", req->bytes[ii]); } fprintf(stderr, "\n"); } c->binary_header = *req; c->binary_header.request.keylen = ntohs(req->request.keylen); c->binary_header.request.bodylen = ntohl(req->request.bodylen); c->binary_header.request.cas = ntohll(req->request.cas); if (c->binary_header.request.magic != PROTOCOL_BINARY_REQ) { if (settings.verbose) { fprintf(stderr, "Invalid magic: %x\n", c->binary_header.request.magic); } conn_set_state(c, conn_closing); return -1; } c->msgcurr = 0; c->msgused = 0; c->iovused = 0; if (add_msghdr(c) != 0) { out_string(c, "SERVER_ERROR out of memory"); return 0; } c->cmd = c->binary_header.request.opcode; c->keylen = c->binary_header.request.keylen; c->opaque = c->binary_header.request.opaque; /* clear the returned cas value */ c->cas = 0; dispatch_bin_command(c); c->rbytes -= sizeof(c->binary_header); c->rcurr += sizeof(c->binary_header); } } else { char *el, *cont; if (c->rbytes == 0) return 0; el = memchr(c->rcurr, '\n', c->rbytes); if (!el) return 0; cont = el + 1; if ((el - c->rcurr) > 1 && *(el - 1) == '\r') { el--; } *el = '\0'; assert(cont <= (c->rcurr + c->rbytes)); process_command(c, c->rcurr); c->rbytes -= (cont - c->rcurr); c->rcurr = cont; assert(c->rcurr <= (c->rbuf + c->rsize)); } return 1; }
672
True
1
CVE-2010-1152
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://github.com/memcached/memcached/commit/d9cd01ede97f4145af9781d448c62a3318952719', 'name': 'http://github.com/memcached/memcached/commit/d9cd01ede97f4145af9781d448c62a3318952719', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/39306', 'name': '39306', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://github.com/memcached/memcached/commit/75cc83685e103bc8ba380a57468c8f04413033f9', 'name': 'http://github.com/memcached/memcached/commit/75cc83685e103bc8ba380a57468c8f04413033f9', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127075808518733&w=2', 'name': '[oss-security] 20100408 Re: CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127075341110616&w=2', 'name': '[oss-security] 20100408 Re: CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127074597129559&w=2', 'name': '[oss-security] 20100408 CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://code.google.com/p/memcached/issues/detail?id=102', 'name': 'http://code.google.com/p/memcached/issues/detail?id=102', 'refsource': 'CONFIRM', 'tags': ['Exploit']}, {'url': 'http://securitytracker.com/id?1023839', 'name': '1023839', 'refsource': 'SECTRACK', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00002.html', 'name': 'SUSE-SR:2010:012', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-06/msg00001.html', 'name': 'SUSE-SR:2010:013', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2011/0442', 'name': 'ADV-2011-0442', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://blogs.sun.com/security/entry/input_validation_vulnerability_in_memcached', 'name': 'http://blogs.sun.com/security/entry/input_validation_vulnerability_in_memcached', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.1:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.4.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.1.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.1:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.2:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.1.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'memcached.c in memcached before 1.4.3 allows remote attackers to cause a denial of service (daemon hang or crash) via a long line that triggers excessive memory allocation. NOTE: some of these details are obtained from third party information.'}]
2011-03-01T07:01Z
2010-04-12T18:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Trond Norbye
2009-10-28 11:51:05+01:00
Issue 102: Piping null to the server will crash it
75cc83685e103bc8ba380a57468c8f04413033f9
False
memcached/memcached
memcached development tree
2009-04-24 23:34:25
2022-08-27 00:43:06
https://memcached.org
memcached
12057.0
3109.0
try_read_network
try_read_network( conn * c)
['c']
static enum try_read_result try_read_network(conn *c) { enum try_read_result gotdata = READ_NO_DATA_RECEIVED; int res; assert(c != NULL); if (c->rcurr != c->rbuf) { if (c->rbytes != 0) /* otherwise there's nothing to copy */ memmove(c->rbuf, c->rcurr, c->rbytes); c->rcurr = c->rbuf; } while (1) { if (c->rbytes >= c->rsize) { char *new_rbuf = realloc(c->rbuf, c->rsize * 2); if (!new_rbuf) { if (settings.verbose > 0) fprintf(stderr, "Couldn't realloc input buffer\n"); c->rbytes = 0; /* ignore what we read */ out_string(c, "SERVER_ERROR out of memory reading request"); c->write_and_go = conn_closing; return READ_MEMORY_ERROR; } c->rcurr = c->rbuf = new_rbuf; c->rsize *= 2; } int avail = c->rsize - c->rbytes; res = read(c->sfd, c->rbuf + c->rbytes, avail); if (res > 0) { pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.bytes_read += res; pthread_mutex_unlock(&c->thread->stats.mutex); gotdata = READ_DATA_RECEIVED; c->rbytes += res; if (res == avail) { continue; } else { break; } } if (res == 0) { return READ_ERROR; } if (res == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK) { break; } return READ_ERROR; } } return gotdata; }
300
True
1
CVE-2010-1152
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://github.com/memcached/memcached/commit/d9cd01ede97f4145af9781d448c62a3318952719', 'name': 'http://github.com/memcached/memcached/commit/d9cd01ede97f4145af9781d448c62a3318952719', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/39306', 'name': '39306', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://github.com/memcached/memcached/commit/75cc83685e103bc8ba380a57468c8f04413033f9', 'name': 'http://github.com/memcached/memcached/commit/75cc83685e103bc8ba380a57468c8f04413033f9', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127075808518733&w=2', 'name': '[oss-security] 20100408 Re: CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127075341110616&w=2', 'name': '[oss-security] 20100408 Re: CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://marc.info/?l=oss-security&m=127074597129559&w=2', 'name': '[oss-security] 20100408 CVE request -- memcached', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://code.google.com/p/memcached/issues/detail?id=102', 'name': 'http://code.google.com/p/memcached/issues/detail?id=102', 'refsource': 'CONFIRM', 'tags': ['Exploit']}, {'url': 'http://securitytracker.com/id?1023839', 'name': '1023839', 'refsource': 'SECTRACK', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00002.html', 'name': 'SUSE-SR:2010:012', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-06/msg00001.html', 'name': 'SUSE-SR:2010:013', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2011/0442', 'name': 'ADV-2011-0442', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://blogs.sun.com/security/entry/input_validation_vulnerability_in_memcached', 'name': 'http://blogs.sun.com/security/entry/input_validation_vulnerability_in_memcached', 'refsource': 'CONFIRM', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.1:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.4.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.1.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.1:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.0.2:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.1.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.2', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:0.1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.2.0:beta:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcachedb:memcached:1.4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'memcached.c in memcached before 1.4.3 allows remote attackers to cause a denial of service (daemon hang or crash) via a long line that triggers excessive memory allocation. NOTE: some of these details are obtained from third party information.'}]
2011-03-01T07:01Z
2010-04-12T18:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Tomash Brechko
2009-11-02 18:15:54+01:00
Use strncmp when checking for large ascii multigets.
d9cd01ede97f4145af9781d448c62a3318952719
False
memcached/memcached
memcached development tree
2009-04-24 23:34:25
2022-08-27 00:43:06
https://memcached.org
memcached
12057.0
3109.0
try_read_command
try_read_command( conn * c)
['c']
static int try_read_command(conn *c) { assert(c != NULL); assert(c->rcurr <= (c->rbuf + c->rsize)); assert(c->rbytes > 0); if (c->protocol == negotiating_prot || c->transport == udp_transport) { if ((unsigned char)c->rbuf[0] == (unsigned char)PROTOCOL_BINARY_REQ) { c->protocol = binary_prot; } else { c->protocol = ascii_prot; } if (settings.verbose > 1) { fprintf(stderr, "%d: Client using the %s protocol\n", c->sfd, prot_text(c->protocol)); } } if (c->protocol == binary_prot) { /* Do we have the complete packet header? */ if (c->rbytes < sizeof(c->binary_header)) { /* need more data! */ return 0; } else { #ifdef NEED_ALIGN if (((long)(c->rcurr)) % 8 != 0) { /* must realign input buffer */ memmove(c->rbuf, c->rcurr, c->rbytes); c->rcurr = c->rbuf; if (settings.verbose > 1) { fprintf(stderr, "%d: Realign input buffer\n", c->sfd); } } #endif protocol_binary_request_header* req; req = (protocol_binary_request_header*)c->rcurr; if (settings.verbose > 1) { /* Dump the packet before we convert it to host order */ int ii; fprintf(stderr, "<%d Read binary protocol data:", c->sfd); for (ii = 0; ii < sizeof(req->bytes); ++ii) { if (ii % 4 == 0) { fprintf(stderr, "\n<%d ", c->sfd); } fprintf(stderr, " 0x%02x", req->bytes[ii]); } fprintf(stderr, "\n"); } c->binary_header = *req; c->binary_header.request.keylen = ntohs(req->request.keylen); c->binary_header.request.bodylen = ntohl(req->request.bodylen); c->binary_header.request.cas = ntohll(req->request.cas); if (c->binary_header.request.magic != PROTOCOL_BINARY_REQ) { if (settings.verbose) { fprintf(stderr, "Invalid magic: %x\n", c->binary_header.request.magic); } conn_set_state(c, conn_closing); return -1; } c->msgcurr = 0; c->msgused = 0; c->iovused = 0; if (add_msghdr(c) != 0) { out_string(c, "SERVER_ERROR out of memory"); return 0; } c->cmd = c->binary_header.request.opcode; c->keylen = c->binary_header.request.keylen; c->opaque = c->binary_header.request.opaque; /* clear the returned cas value */ c->cas = 0; dispatch_bin_command(c); c->rbytes -= sizeof(c->binary_header); c->rcurr += sizeof(c->binary_header); } } else { char *el, *cont; if (c->rbytes == 0) return 0; el = memchr(c->rcurr, '\n', c->rbytes); if (!el) { if (c->rbytes > 1024) { /* * We didn't have a '\n' in the first k. This _has_ to be a * large multiget, if not we should just nuke the connection. */ char *ptr = c->rcurr; while (*ptr == ' ') { /* ignore leading whitespaces */ ++ptr; } if (strcmp(ptr, "get ") && strcmp(ptr, "gets ")) { conn_set_state(c, conn_closing); return 1; } } return 0; } cont = el + 1; if ((el - c->rcurr) > 1 && *(el - 1) == '\r') { el--; } *el = '\0'; assert(cont <= (c->rcurr + c->rbytes)); process_command(c, c->rcurr); c->rbytes -= (cont - c->rcurr); c->rcurr = cont; assert(c->rcurr <= (c->rbuf + c->rsize)); } return 1; }
732
True
1
CVE-2018-1000127
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
True
[{'url': 'https://github.com/memcached/memcached/wiki/ReleaseNotes1437', 'name': 'https://github.com/memcached/memcached/wiki/ReleaseNotes1437', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/issues/271', 'name': 'https://github.com/memcached/memcached/issues/271', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/commit/a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00', 'name': 'https://github.com/memcached/memcached/commit/a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3601-1/', 'name': 'USN-3601-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/03/msg00031.html', 'name': '[debian-lts-announce] 20180329 [SECURITY] [DLA 1329-1] memcached security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4218', 'name': 'DSA-4218', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2018:2290', 'name': 'RHSA-2018:2290', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}, {'lang': 'en', 'value': 'CWE-667'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcached:memcached:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.4.37', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:17.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openstack:10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'memcached version prior to 1.4.37 contains an Integer Overflow vulnerability in items.c:item_free() that can result in data corruption and deadlocks due to items existing in hash table being reused from free list. This attack appear to be exploitable via network connectivity to the memcached service. This vulnerability appears to have been fixed in 1.4.37 and later.'}]
2020-08-24T17:37Z
2018-03-13T21:29Z
Integer Overflow or Wraparound
The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.
An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.
https://cwe.mitre.org/data/definitions/190.html
0
dormando
2017-05-21 21:49:54-07:00
Don't overflow item refcount on get Counts as a miss if the refcount is too high. ASCII multigets are the only time refcounts can be held for so long. doing a dirty read of refcount. is aligned. trying to avoid adding an extra refcount branch for all calls of item_get due to performance. might be able to move it in there after logging refactoring simplifies some of the branches.
a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00
False
memcached/memcached
memcached development tree
2009-04-24 23:34:25
2022-08-27 00:43:06
https://memcached.org
memcached
12057.0
3109.0
process_get_command
process_get_command( conn * c , token_t * tokens , size_t ntokens , bool return_cas)
['c', 'tokens', 'ntokens', 'return_cas']
static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) { char *key; size_t nkey; int i = 0; item *it; token_t *key_token = &tokens[KEY_TOKEN]; char *suffix; assert(c != NULL); do { while(key_token->length != 0) { key = key_token->value; nkey = key_token->length; if(nkey > KEY_MAX_LENGTH) { out_string(c, "CLIENT_ERROR bad command line format"); while (i-- > 0) { item_remove(*(c->ilist + i)); } return; } it = item_get(key, nkey, c, DO_UPDATE); if (settings.detail_enabled) { stats_prefix_record_get(key, nkey, NULL != it); } if (it) { if (i >= c->isize) { item **new_list = realloc(c->ilist, sizeof(item *) * c->isize * 2); if (new_list) { c->isize *= 2; c->ilist = new_list; } else { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); item_remove(it); break; } } /* * Construct the response. Each hit adds three elements to the * outgoing data list: * "VALUE " * key * " " + flags + " " + data length + "\r\n" + data (with \r\n) */ if (return_cas || !settings.inline_ascii_response) { MEMCACHED_COMMAND_GET(c->sfd, ITEM_key(it), it->nkey, it->nbytes, ITEM_get_cas(it)); /* Goofy mid-flight realloc. */ if (i >= c->suffixsize) { char **new_suffix_list = realloc(c->suffixlist, sizeof(char *) * c->suffixsize * 2); if (new_suffix_list) { c->suffixsize *= 2; c->suffixlist = new_suffix_list; } else { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); item_remove(it); break; } } suffix = do_cache_alloc(c->thread->suffix_cache); if (suffix == NULL) { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); out_of_memory(c, "SERVER_ERROR out of memory making CAS suffix"); item_remove(it); while (i-- > 0) { item_remove(*(c->ilist + i)); } return; } *(c->suffixlist + i) = suffix; int suffix_len = make_ascii_get_suffix(suffix, it, return_cas); if (add_iov(c, "VALUE ", 6) != 0 || add_iov(c, ITEM_key(it), it->nkey) != 0 || (settings.inline_ascii_response && add_iov(c, ITEM_suffix(it), it->nsuffix - 2) != 0) || add_iov(c, suffix, suffix_len) != 0) { item_remove(it); break; } if ((it->it_flags & ITEM_CHUNKED) == 0) { add_iov(c, ITEM_data(it), it->nbytes); } else if (add_chunked_item_iovs(c, it, it->nbytes) != 0) { item_remove(it); break; } } else { MEMCACHED_COMMAND_GET(c->sfd, ITEM_key(it), it->nkey, it->nbytes, ITEM_get_cas(it)); if (add_iov(c, "VALUE ", 6) != 0 || add_iov(c, ITEM_key(it), it->nkey) != 0) { item_remove(it); break; } if ((it->it_flags & ITEM_CHUNKED) == 0) { if (add_iov(c, ITEM_suffix(it), it->nsuffix + it->nbytes) != 0) { item_remove(it); break; } } else if (add_iov(c, ITEM_suffix(it), it->nsuffix) != 0 || add_chunked_item_iovs(c, it, it->nbytes) != 0) { item_remove(it); break; } } if (settings.verbose > 1) { int ii; fprintf(stderr, ">%d sending key ", c->sfd); for (ii = 0; ii < it->nkey; ++ii) { fprintf(stderr, "%c", key[ii]); } fprintf(stderr, "\n"); } /* item_get() has incremented it->refcount for us */ pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.slab_stats[ITEM_clsid(it)].get_hits++; c->thread->stats.get_cmds++; pthread_mutex_unlock(&c->thread->stats.mutex); *(c->ilist + i) = it; i++; } else { pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.get_misses++; c->thread->stats.get_cmds++; pthread_mutex_unlock(&c->thread->stats.mutex); MEMCACHED_COMMAND_GET(c->sfd, key, nkey, -1, 0); } key_token++; } /* * If the command string hasn't been fully processed, get the next set * of tokens. */ if(key_token->value != NULL) { ntokens = tokenize_command(key_token->value, tokens, MAX_TOKENS); key_token = tokens; } } while(key_token->value != NULL); c->icurr = c->ilist; c->ileft = i; if (return_cas || !settings.inline_ascii_response) { c->suffixcurr = c->suffixlist; c->suffixleft = i; } if (settings.verbose > 1) fprintf(stderr, ">%d END\n", c->sfd); /* If the loop was terminated because of out-of-memory, it is not reliable to add END\r\n to the buffer, because it might not end in \r\n. So we send SERVER_ERROR instead. */ if (key_token->value != NULL || add_iov(c, "END\r\n", 5) != 0 || (IS_UDP(c->transport) && build_udp_headers(c) != 0)) { out_of_memory(c, "SERVER_ERROR out of memory writing get response"); } else { conn_set_state(c, conn_mwrite); c->msgcurr = 0; } }
1052
True
1
CVE-2018-1000127
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
True
[{'url': 'https://github.com/memcached/memcached/wiki/ReleaseNotes1437', 'name': 'https://github.com/memcached/memcached/wiki/ReleaseNotes1437', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/issues/271', 'name': 'https://github.com/memcached/memcached/issues/271', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/commit/a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00', 'name': 'https://github.com/memcached/memcached/commit/a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3601-1/', 'name': 'USN-3601-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2018/03/msg00031.html', 'name': '[debian-lts-announce] 20180329 [SECURITY] [DLA 1329-1] memcached security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4218', 'name': 'DSA-4218', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2018:2290', 'name': 'RHSA-2018:2290', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-190'}, {'lang': 'en', 'value': 'CWE-667'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcached:memcached:*:*:*:*:*:*:*:*', 'versionEndExcluding': '1.4.37', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:7.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:17.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openstack:10:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'memcached version prior to 1.4.37 contains an Integer Overflow vulnerability in items.c:item_free() that can result in data corruption and deadlocks due to items existing in hash table being reused from free list. This attack appear to be exploitable via network connectivity to the memcached service. This vulnerability appears to have been fixed in 1.4.37 and later.'}]
2020-08-24T17:37Z
2018-03-13T21:29Z
Improper Locking
The software does not properly acquire or release a lock on a resource, leading to unexpected resource state changes and behaviors.
Locking is a type of synchronization behavior that ensures that multiple independently-operating processes or threads do not interfere with each other when accessing the same resource. All processes/threads are expected to follow the same steps for locking. If these steps are not followed precisely - or if no locking is done at all - then another process/thread could modify the shared resource in a way that is not visible or predictable to the original process. This can lead to data or memory corruption, denial of service, etc.
https://cwe.mitre.org/data/definitions/667.html
0
dormando
2017-05-21 21:49:54-07:00
Don't overflow item refcount on get Counts as a miss if the refcount is too high. ASCII multigets are the only time refcounts can be held for so long. doing a dirty read of refcount. is aligned. trying to avoid adding an extra refcount branch for all calls of item_get due to performance. might be able to move it in there after logging refactoring simplifies some of the branches.
a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00
False
memcached/memcached
memcached development tree
2009-04-24 23:34:25
2022-08-27 00:43:06
https://memcached.org
memcached
12057.0
3109.0
process_get_command
process_get_command( conn * c , token_t * tokens , size_t ntokens , bool return_cas)
['c', 'tokens', 'ntokens', 'return_cas']
static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) { char *key; size_t nkey; int i = 0; item *it; token_t *key_token = &tokens[KEY_TOKEN]; char *suffix; assert(c != NULL); do { while(key_token->length != 0) { key = key_token->value; nkey = key_token->length; if(nkey > KEY_MAX_LENGTH) { out_string(c, "CLIENT_ERROR bad command line format"); while (i-- > 0) { item_remove(*(c->ilist + i)); } return; } it = item_get(key, nkey, c, DO_UPDATE); if (settings.detail_enabled) { stats_prefix_record_get(key, nkey, NULL != it); } if (it) { if (i >= c->isize) { item **new_list = realloc(c->ilist, sizeof(item *) * c->isize * 2); if (new_list) { c->isize *= 2; c->ilist = new_list; } else { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); item_remove(it); break; } } /* * Construct the response. Each hit adds three elements to the * outgoing data list: * "VALUE " * key * " " + flags + " " + data length + "\r\n" + data (with \r\n) */ if (return_cas || !settings.inline_ascii_response) { MEMCACHED_COMMAND_GET(c->sfd, ITEM_key(it), it->nkey, it->nbytes, ITEM_get_cas(it)); /* Goofy mid-flight realloc. */ if (i >= c->suffixsize) { char **new_suffix_list = realloc(c->suffixlist, sizeof(char *) * c->suffixsize * 2); if (new_suffix_list) { c->suffixsize *= 2; c->suffixlist = new_suffix_list; } else { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); item_remove(it); break; } } suffix = do_cache_alloc(c->thread->suffix_cache); if (suffix == NULL) { STATS_LOCK(); stats.malloc_fails++; STATS_UNLOCK(); out_of_memory(c, "SERVER_ERROR out of memory making CAS suffix"); item_remove(it); while (i-- > 0) { item_remove(*(c->ilist + i)); } return; } *(c->suffixlist + i) = suffix; int suffix_len = make_ascii_get_suffix(suffix, it, return_cas); if (add_iov(c, "VALUE ", 6) != 0 || add_iov(c, ITEM_key(it), it->nkey) != 0 || (settings.inline_ascii_response && add_iov(c, ITEM_suffix(it), it->nsuffix - 2) != 0) || add_iov(c, suffix, suffix_len) != 0) { item_remove(it); break; } if ((it->it_flags & ITEM_CHUNKED) == 0) { add_iov(c, ITEM_data(it), it->nbytes); } else if (add_chunked_item_iovs(c, it, it->nbytes) != 0) { item_remove(it); break; } } else { MEMCACHED_COMMAND_GET(c->sfd, ITEM_key(it), it->nkey, it->nbytes, ITEM_get_cas(it)); if (add_iov(c, "VALUE ", 6) != 0 || add_iov(c, ITEM_key(it), it->nkey) != 0) { item_remove(it); break; } if ((it->it_flags & ITEM_CHUNKED) == 0) { if (add_iov(c, ITEM_suffix(it), it->nsuffix + it->nbytes) != 0) { item_remove(it); break; } } else if (add_iov(c, ITEM_suffix(it), it->nsuffix) != 0 || add_chunked_item_iovs(c, it, it->nbytes) != 0) { item_remove(it); break; } } if (settings.verbose > 1) { int ii; fprintf(stderr, ">%d sending key ", c->sfd); for (ii = 0; ii < it->nkey; ++ii) { fprintf(stderr, "%c", key[ii]); } fprintf(stderr, "\n"); } /* item_get() has incremented it->refcount for us */ pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.slab_stats[ITEM_clsid(it)].get_hits++; c->thread->stats.get_cmds++; pthread_mutex_unlock(&c->thread->stats.mutex); *(c->ilist + i) = it; i++; } else { pthread_mutex_lock(&c->thread->stats.mutex); c->thread->stats.get_misses++; c->thread->stats.get_cmds++; pthread_mutex_unlock(&c->thread->stats.mutex); MEMCACHED_COMMAND_GET(c->sfd, key, nkey, -1, 0); } key_token++; } /* * If the command string hasn't been fully processed, get the next set * of tokens. */ if(key_token->value != NULL) { ntokens = tokenize_command(key_token->value, tokens, MAX_TOKENS); key_token = tokens; } } while(key_token->value != NULL); c->icurr = c->ilist; c->ileft = i; if (return_cas || !settings.inline_ascii_response) { c->suffixcurr = c->suffixlist; c->suffixleft = i; } if (settings.verbose > 1) fprintf(stderr, ">%d END\n", c->sfd); /* If the loop was terminated because of out-of-memory, it is not reliable to add END\r\n to the buffer, because it might not end in \r\n. So we send SERVER_ERROR instead. */ if (key_token->value != NULL || add_iov(c, "END\r\n", 5) != 0 || (IS_UDP(c->transport) && build_udp_headers(c) != 0)) { out_of_memory(c, "SERVER_ERROR out of memory writing get response"); } else { conn_set_state(c, conn_mwrite); c->msgcurr = 0; } }
1052
True
1
CVE-2018-1000115
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://twitter.com/dormando/status/968579781729009664', 'name': 'https://twitter.com/dormando/status/968579781729009664', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/wiki/ReleaseNotes156', 'name': 'https://github.com/memcached/memcached/wiki/ReleaseNotes156', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/issues/348', 'name': 'https://github.com/memcached/memcached/issues/348', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/commit/dbb7a8af90054bf4ef51f5814ef7ceb17d83d974', 'name': 'https://github.com/memcached/memcached/commit/dbb7a8af90054bf4ef51f5814ef7ceb17d83d974', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://blogs.akamai.com/2018/03/memcached-fueled-13-tbps-attacks.html', 'name': 'https://blogs.akamai.com/2018/03/memcached-fueled-13-tbps-attacks.html', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://www.exploit-db.com/exploits/44264/', 'name': '44264', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://www.exploit-db.com/exploits/44265/', 'name': '44265', 'refsource': 'EXPLOIT-DB', 'tags': ['Exploit', 'Third Party Advisory', 'VDB Entry']}, {'url': 'https://www.synology.com/support/security/Synology_SA_18_07', 'name': 'https://www.synology.com/support/security/Synology_SA_18_07', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/3588-1/', 'name': 'USN-3588-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2018:1627', 'name': 'RHSA-2018:1627', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2018:1593', 'name': 'RHSA-2018:1593', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4218', 'name': 'DSA-4218', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2018:2331', 'name': 'RHSA-2018:2331', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHBA-2018:2140', 'name': 'RHBA-2018:2140', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/errata/RHSA-2018:2857', 'name': 'RHSA-2018:2857', 'refsource': 'REDHAT', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-400'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcached:memcached:1.5.5:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:14.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:17.10:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openstack:10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openstack:12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openstack:9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openstack:8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:redhat:openstack:11:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Memcached version 1.5.5 contains an Insufficient Control of Network Message Volume (Network Amplification, CWE-406) vulnerability in the UDP support of the memcached server that can result in denial of service via network flood (traffic amplification of 1:50,000 has been reported by reliable sources). This attack appear to be exploitable via network connectivity to port 11211 UDP. This vulnerability appears to have been fixed in 1.5.6 due to the disabling of the UDP protocol by default.'}]
2021-08-04T17:15Z
2018-03-05T14:29Z
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Limited resources include memory, file system storage, database connection pool entries, and 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. There are at least three distinct scenarios which can commonly lead to resource exhaustion: Lack of throttling for the number of allocated resources Losing all references to a resource before reaching the shutdown stage Not closing/returning a resource after processing Resource exhaustion problems are often result due to an incorrect implementation of the following situations: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for releasing the resource.
https://cwe.mitre.org/data/definitions/400.html
0
dormando
2018-02-27 10:50:45-08:00
disable UDP port by default As reported, UDP amplification attacks have started to use insecure internet-exposed memcached instances. UDP used to be a lot more popular as a transport for memcached many years ago, but I'm not aware of many recent users. Ten years ago, the TCP connection overhead from many clients was relatively high (dozens or hundreds per client server), but these days many clients are batched, or user fewer processes, or simply anre't worried about it. While changing the default to listen on localhost only would also help, the true culprit is UDP. There are many more use cases for using memcached over the network than there are for using the UDP protocol.
dbb7a8af90054bf4ef51f5814ef7ceb17d83d974
False
memcached/memcached
memcached development tree
2009-04-24 23:34:25
2022-08-27 00:43:06
https://memcached.org
memcached
12057.0
3109.0
settings_init
settings_init( void)
['void']
static void settings_init(void) { settings.use_cas = true; settings.access = 0700; settings.port = 11211; settings.udpport = 11211; /* By default this string should be NULL for getaddrinfo() */ settings.inter = NULL; settings.maxbytes = 64 * 1024 * 1024; /* default is 64MB */ settings.maxconns = 1024; /* to limit connections-related memory to about 5MB */ settings.verbose = 0; settings.oldest_live = 0; settings.oldest_cas = 0; /* supplements accuracy of oldest_live */ settings.evict_to_free = 1; /* push old items out of cache when memory runs out */ settings.socketpath = NULL; /* by default, not using a unix socket */ settings.factor = 1.25; settings.chunk_size = 48; /* space for a modest key and value */ settings.num_threads = 4; /* N workers */ settings.num_threads_per_udp = 0; settings.prefix_delimiter = ':'; settings.detail_enabled = 0; settings.reqs_per_event = 20; settings.backlog = 1024; settings.binding_protocol = negotiating_prot; settings.item_size_max = 1024 * 1024; /* The famous 1MB upper limit. */ settings.slab_page_size = 1024 * 1024; /* chunks are split from 1MB pages. */ settings.slab_chunk_size_max = settings.slab_page_size / 2; settings.sasl = false; settings.maxconns_fast = true; settings.lru_crawler = false; settings.lru_crawler_sleep = 100; settings.lru_crawler_tocrawl = 0; settings.lru_maintainer_thread = false; settings.lru_segmented = true; settings.hot_lru_pct = 20; settings.warm_lru_pct = 40; settings.hot_max_factor = 0.2; settings.warm_max_factor = 2.0; settings.inline_ascii_response = false; settings.temp_lru = false; settings.temporary_ttl = 61; settings.idle_timeout = 0; /* disabled */ settings.hashpower_init = 0; settings.slab_reassign = true; settings.slab_automove = 1; settings.slab_automove_ratio = 0.8; settings.slab_automove_window = 30; settings.shutdown_command = false; settings.tail_repair_time = TAIL_REPAIR_TIME_DEFAULT; settings.flush_enabled = true; settings.dump_enabled = true; settings.crawls_persleep = 1000; settings.logger_watcher_buf_size = LOGGER_WATCHER_BUF_SIZE; settings.logger_buf_size = LOGGER_BUF_SIZE; settings.drop_privileges = true; #ifdef MEMCACHED_DEBUG settings.relaxed_privileges = false; #endif }
344
True
1
CVE-2019-15026
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/memcached/memcached/wiki/ReleaseNotes1517', 'name': 'https://github.com/memcached/memcached/wiki/ReleaseNotes1517', 'refsource': 'CONFIRM', 'tags': ['Release Notes', 'Third Party Advisory']}, {'url': 'https://github.com/memcached/memcached/commit/554b56687a19300a75ec24184746b5512580c819', 'name': 'https://github.com/memcached/memcached/commit/554b56687a19300a75ec24184746b5512580c819', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/09/msg00006.html', 'name': '[debian-lts-announce] 20190907 [SECURITY] [DLA 1913-1] memcached security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://usn.ubuntu.com/4125-1/', 'name': 'USN-4125-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/QDBV5OGV3FJDAH4NO4JSXNRWHDGGKWYB/', 'name': 'FEDORA-2019-694a4b39a9', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/EOD422IS2OPXRDID5EKFZHFUHK2BLQGJ/', 'name': 'FEDORA-2019-68333329e0', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/FYGUBOEM5HX4GRMWVEKOJUFICF77ME47/', 'name': 'FEDORA-2019-15d61c1f7f', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00060.html', 'name': 'openSUSE-SU-2020:0721', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:memcached:memcached:1.5.16:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'memcached 1.5.16, when UNIX sockets are used, has a stack-based buffer over-read in conn_to_str in memcached.c.'}]
2020-05-26T16:15Z
2019-08-30T15:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
dormando
2019-08-29 14:10:44-07:00
fix strncpy call to avoid ASAN violation Ensure we're only reading to the size of the smallest buffer, since they're both on the stack and could potentially overlap. Overlapping is defined as ... undefined behavior. I've looked through all available implementations of strncpy and they still only copy from the first \0 found. We'll also never read past the end of sun_path since we _supply_ sun_path with a proper null terminator.
554b56687a19300a75ec24184746b5512580c819
False
memcached/memcached
memcached development tree
2009-04-24 23:34:25
2022-08-27 00:43:06
https://memcached.org
memcached
12057.0
3109.0
get_conn_text
get_conn_text( const conn * c , const int af , char * addr , struct sockaddr * sock_addr)
['c', 'af', 'addr', 'sock_addr']
static inline void get_conn_text(const conn *c, const int af, char* addr, struct sockaddr *sock_addr) { char addr_text[MAXPATHLEN]; addr_text[0] = '\0'; const char *protoname = "?"; unsigned short port = 0; switch (af) { case AF_INET: (void) inet_ntop(af, &((struct sockaddr_in *)sock_addr)->sin_addr, addr_text, sizeof(addr_text) - 1); port = ntohs(((struct sockaddr_in *)sock_addr)->sin_port); protoname = IS_UDP(c->transport) ? "udp" : "tcp"; break; case AF_INET6: addr_text[0] = '['; addr_text[1] = '\0'; if (inet_ntop(af, &((struct sockaddr_in6 *)sock_addr)->sin6_addr, addr_text + 1, sizeof(addr_text) - 2)) { strcat(addr_text, "]"); } port = ntohs(((struct sockaddr_in6 *)sock_addr)->sin6_port); protoname = IS_UDP(c->transport) ? "udp6" : "tcp6"; break; case AF_UNIX: strncpy(addr_text, ((struct sockaddr_un *)sock_addr)->sun_path, sizeof(addr_text) - 1); addr_text[sizeof(addr_text)-1] = '\0'; protoname = "unix"; break; } if (strlen(addr_text) < 2) { /* Most likely this is a connected UNIX-domain client which * has no peer socket address, but there's no portable way * to tell for sure. */ sprintf(addr_text, "<AF %d>", af); } if (port) { sprintf(addr, "%s:%s:%u", protoname, addr_text, port); } else { sprintf(addr, "%s:%s", protoname, addr_text); } }
301
True
1
CVE-2010-1155
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.ubuntu.com/usn/USN-929-1', 'name': 'USN-929-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127116251220784&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/39365', 'name': '39365', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://irssi.org/news/ChangeLog', 'name': 'http://irssi.org/news/ChangeLog', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127110132019166&w=2', 'name': '[oss-security] 20100412 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0856', 'name': 'ADV-2010-0856', 'refsource': 'VUPEN', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://irssi.org/news', 'name': 'http://irssi.org/news', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'name': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127119240204394&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127098845125270&w=2', 'name': '[oss-security] 20100411 CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://slackware.com/security/viewer.php?l=slackware-security&y=2010&m=slackware-security.497301', 'name': 'SSA:2010-116-01', 'refsource': 'SLACKWARE', 'tags': []}, {'url': 'http://secunia.com/advisories/39620', 'name': '39620', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0987', 'name': 'ADV-2010-0987', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1110', 'name': 'ADV-2010-1110', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://secunia.com/advisories/39797', 'name': '39797', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.fedoraproject.org/pipermail/package-announce/2010-May/041054.html', 'name': 'FEDORA-2010-6629', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1107', 'name': 'ADV-2010-1107', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00001.html', 'name': 'SUSE-SR:2010:011', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/57790', 'name': 'irssi-hostname-mitm(57790)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:*:rc1:*:*:*:*:*:*', 'versionEndIncluding': '0.8.15', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc6:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "Irssi before 0.8.15, when SSL is used, does not verify that the server hostname matches a domain name in the subject's Common Name (CN) field or a Subject Alternative Name field of the X.509 certificate, which allows man-in-the-middle attackers to spoof IRC servers via an arbitrary certificate."}]
2017-08-17T01:32Z
2010-04-16T19:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
coekie
2009-12-28 12:15:18+00:00
Check if an SSL certificate matches the hostname of the server we are connecting to git-svn-id: http://svn.irssi.org/repos/irssi/trunk@5104 dbcabf3a-b0e7-0310-adc4-f8d773084564
85bbc05b21678e80423815d2ef1dfe26208491ab
False
ensc/irssi-proxy
Native proxy support (socks5, http) for the irssi IRC client
2009-08-10 07:47:34
2010-04-07 07:51:46
ensc
2.0
2.0
irssi_ssl_get_iochannel
irssi_ssl_get_iochannel( GIOChannel * handle , const char * mycert , const char * mypkey , const char * cafile , const char * capath , gboolean verify)
['handle', 'mycert', 'mypkey', 'cafile', 'capath', 'verify']
static GIOChannel *irssi_ssl_get_iochannel(GIOChannel *handle, const char *mycert, const char *mypkey, const char *cafile, const char *capath, gboolean verify) { GIOSSLChannel *chan; GIOChannel *gchan; int fd; SSL *ssl; SSL_CTX *ctx = NULL; g_return_val_if_fail(handle != NULL, NULL); if(!ssl_ctx && !irssi_ssl_init()) return NULL; if(!(fd = g_io_channel_unix_get_fd(handle))) return NULL; if (mycert && *mycert) { char *scert = NULL, *spkey = NULL; if ((ctx = SSL_CTX_new(SSLv23_client_method())) == NULL) { g_error("Could not allocate memory for SSL context"); return NULL; } scert = convert_home(mycert); if (mypkey && *mypkey) spkey = convert_home(mypkey); if (! SSL_CTX_use_certificate_file(ctx, scert, SSL_FILETYPE_PEM)) g_warning("Loading of client certificate '%s' failed", mycert); else if (! SSL_CTX_use_PrivateKey_file(ctx, spkey ? spkey : scert, SSL_FILETYPE_PEM)) g_warning("Loading of private key '%s' failed", mypkey ? mypkey : mycert); else if (! SSL_CTX_check_private_key(ctx)) g_warning("Private key does not match the certificate"); g_free(scert); g_free(spkey); } if ((cafile && *cafile) || (capath && *capath)) { char *scafile = NULL; char *scapath = NULL; if (! ctx && (ctx = SSL_CTX_new(SSLv23_client_method())) == NULL) { g_error("Could not allocate memory for SSL context"); return NULL; } if (cafile && *cafile) scafile = convert_home(cafile); if (capath && *capath) scapath = convert_home(capath); if (! SSL_CTX_load_verify_locations(ctx, scafile, scapath)) { g_warning("Could not load CA list for verifying SSL server certificate"); g_free(scafile); g_free(scapath); SSL_CTX_free(ctx); return NULL; } g_free(scafile); g_free(scapath); verify = TRUE; } if (ctx == NULL) ctx = ssl_ctx; if(!(ssl = SSL_new(ctx))) { g_warning("Failed to allocate SSL structure"); return NULL; } if(!SSL_set_fd(ssl, fd)) { g_warning("Failed to associate socket to SSL stream"); SSL_free(ssl); if (ctx != ssl_ctx) SSL_CTX_free(ctx); return NULL; } SSL_set_mode(ssl, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); chan = g_new0(GIOSSLChannel, 1); chan->fd = fd; chan->giochan = handle; chan->ssl = ssl; chan->ctx = ctx; chan->verify = verify; gchan = (GIOChannel *)chan; gchan->funcs = &irssi_ssl_channel_funcs; g_io_channel_init(gchan); gchan->is_readable = gchan->is_writeable = TRUE; gchan->use_buffer = FALSE; return gchan; }
518
True
1
CVE-2010-1155
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.ubuntu.com/usn/USN-929-1', 'name': 'USN-929-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127116251220784&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/39365', 'name': '39365', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://irssi.org/news/ChangeLog', 'name': 'http://irssi.org/news/ChangeLog', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127110132019166&w=2', 'name': '[oss-security] 20100412 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0856', 'name': 'ADV-2010-0856', 'refsource': 'VUPEN', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://irssi.org/news', 'name': 'http://irssi.org/news', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'name': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127119240204394&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127098845125270&w=2', 'name': '[oss-security] 20100411 CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://slackware.com/security/viewer.php?l=slackware-security&y=2010&m=slackware-security.497301', 'name': 'SSA:2010-116-01', 'refsource': 'SLACKWARE', 'tags': []}, {'url': 'http://secunia.com/advisories/39620', 'name': '39620', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0987', 'name': 'ADV-2010-0987', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1110', 'name': 'ADV-2010-1110', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://secunia.com/advisories/39797', 'name': '39797', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.fedoraproject.org/pipermail/package-announce/2010-May/041054.html', 'name': 'FEDORA-2010-6629', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1107', 'name': 'ADV-2010-1107', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00001.html', 'name': 'SUSE-SR:2010:011', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/57790', 'name': 'irssi-hostname-mitm(57790)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:*:rc1:*:*:*:*:*:*', 'versionEndIncluding': '0.8.15', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc6:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "Irssi before 0.8.15, when SSL is used, does not verify that the server hostname matches a domain name in the subject's Common Name (CN) field or a Subject Alternative Name field of the X.509 certificate, which allows man-in-the-middle attackers to spoof IRC servers via an arbitrary certificate."}]
2017-08-17T01:32Z
2010-04-16T19:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
coekie
2009-12-28 12:15:18+00:00
Check if an SSL certificate matches the hostname of the server we are connecting to git-svn-id: http://svn.irssi.org/repos/irssi/trunk@5104 dbcabf3a-b0e7-0310-adc4-f8d773084564
85bbc05b21678e80423815d2ef1dfe26208491ab
False
ensc/irssi-proxy
Native proxy support (socks5, http) for the irssi IRC client
2009-08-10 07:47:34
2010-04-07 07:51:46
ensc
2.0
2.0
irssi_ssl_handshake
irssi_ssl_handshake( GIOChannel * handle)
['handle']
int irssi_ssl_handshake(GIOChannel *handle) { GIOSSLChannel *chan = (GIOSSLChannel *)handle; int ret, err; X509 *cert; const char *errstr; ret = SSL_connect(chan->ssl); if (ret <= 0) { err = SSL_get_error(chan->ssl, ret); switch (err) { case SSL_ERROR_WANT_READ: return 1; case SSL_ERROR_WANT_WRITE: return 3; case SSL_ERROR_ZERO_RETURN: g_warning("SSL handshake failed: %s", "server closed connection"); return -1; case SSL_ERROR_SYSCALL: errstr = ERR_reason_error_string(ERR_get_error()); if (errstr == NULL && ret == -1) errstr = strerror(errno); g_warning("SSL handshake failed: %s", errstr != NULL ? errstr : "server closed connection unexpectedly"); return -1; default: errstr = ERR_reason_error_string(ERR_get_error()); g_warning("SSL handshake failed: %s", errstr != NULL ? errstr : "unknown SSL error"); return -1; } } cert = SSL_get_peer_certificate(chan->ssl); if (cert == NULL) { g_warning("SSL server supplied no certificate"); return -1; } ret = !chan->verify || irssi_ssl_verify(chan->ssl, chan->ctx, cert); X509_free(cert); return ret ? 0 : -1; }
226
True
1
CVE-2010-1155
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.ubuntu.com/usn/USN-929-1', 'name': 'USN-929-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127116251220784&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/39365', 'name': '39365', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://irssi.org/news/ChangeLog', 'name': 'http://irssi.org/news/ChangeLog', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127110132019166&w=2', 'name': '[oss-security] 20100412 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0856', 'name': 'ADV-2010-0856', 'refsource': 'VUPEN', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://irssi.org/news', 'name': 'http://irssi.org/news', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'name': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127119240204394&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127098845125270&w=2', 'name': '[oss-security] 20100411 CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://slackware.com/security/viewer.php?l=slackware-security&y=2010&m=slackware-security.497301', 'name': 'SSA:2010-116-01', 'refsource': 'SLACKWARE', 'tags': []}, {'url': 'http://secunia.com/advisories/39620', 'name': '39620', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0987', 'name': 'ADV-2010-0987', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1110', 'name': 'ADV-2010-1110', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://secunia.com/advisories/39797', 'name': '39797', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.fedoraproject.org/pipermail/package-announce/2010-May/041054.html', 'name': 'FEDORA-2010-6629', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1107', 'name': 'ADV-2010-1107', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00001.html', 'name': 'SUSE-SR:2010:011', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/57790', 'name': 'irssi-hostname-mitm(57790)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:*:rc1:*:*:*:*:*:*', 'versionEndIncluding': '0.8.15', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc6:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "Irssi before 0.8.15, when SSL is used, does not verify that the server hostname matches a domain name in the subject's Common Name (CN) field or a Subject Alternative Name field of the X.509 certificate, which allows man-in-the-middle attackers to spoof IRC servers via an arbitrary certificate."}]
2017-08-17T01:32Z
2010-04-16T19:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
coekie
2009-12-28 12:15:18+00:00
Check if an SSL certificate matches the hostname of the server we are connecting to git-svn-id: http://svn.irssi.org/repos/irssi/trunk@5104 dbcabf3a-b0e7-0310-adc4-f8d773084564
85bbc05b21678e80423815d2ef1dfe26208491ab
False
ensc/irssi-proxy
Native proxy support (socks5, http) for the irssi IRC client
2009-08-10 07:47:34
2010-04-07 07:51:46
ensc
2.0
2.0
irssi_ssl_verify
irssi_ssl_verify( SSL * ssl , SSL_CTX * ctx , X509 * cert)
['ssl', 'ctx', 'cert']
static gboolean irssi_ssl_verify(SSL *ssl, SSL_CTX *ctx, X509 *cert) { if (SSL_get_verify_result(ssl) != X509_V_OK) { unsigned char md[EVP_MAX_MD_SIZE]; unsigned int n; char *str; g_warning("Could not verify SSL servers certificate:"); if ((str = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0)) == NULL) g_warning(" Could not get subject-name from peer certificate"); else { g_warning(" Subject : %s", str); free(str); } if ((str = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0)) == NULL) g_warning(" Could not get issuer-name from peer certificate"); else { g_warning(" Issuer : %s", str); free(str); } if (! X509_digest(cert, EVP_md5(), md, &n)) g_warning(" Could not get fingerprint from peer certificate"); else { char hex[] = "0123456789ABCDEF"; char fp[EVP_MAX_MD_SIZE*3]; if (n < sizeof(fp)) { unsigned int i; for (i = 0; i < n; i++) { fp[i*3+0] = hex[(md[i] >> 4) & 0xF]; fp[i*3+1] = hex[(md[i] >> 0) & 0xF]; fp[i*3+2] = i == n - 1 ? '\0' : ':'; } g_warning(" MD5 Fingerprint : %s", fp); } } return FALSE; } return TRUE; }
277
True
1
CVE-2010-1155
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.ubuntu.com/usn/USN-929-1', 'name': 'USN-929-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127116251220784&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/39365', 'name': '39365', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://irssi.org/news/ChangeLog', 'name': 'http://irssi.org/news/ChangeLog', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127110132019166&w=2', 'name': '[oss-security] 20100412 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0856', 'name': 'ADV-2010-0856', 'refsource': 'VUPEN', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://irssi.org/news', 'name': 'http://irssi.org/news', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'name': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127119240204394&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127098845125270&w=2', 'name': '[oss-security] 20100411 CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://slackware.com/security/viewer.php?l=slackware-security&y=2010&m=slackware-security.497301', 'name': 'SSA:2010-116-01', 'refsource': 'SLACKWARE', 'tags': []}, {'url': 'http://secunia.com/advisories/39620', 'name': '39620', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0987', 'name': 'ADV-2010-0987', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1110', 'name': 'ADV-2010-1110', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://secunia.com/advisories/39797', 'name': '39797', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.fedoraproject.org/pipermail/package-announce/2010-May/041054.html', 'name': 'FEDORA-2010-6629', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1107', 'name': 'ADV-2010-1107', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00001.html', 'name': 'SUSE-SR:2010:011', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/57790', 'name': 'irssi-hostname-mitm(57790)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:*:rc1:*:*:*:*:*:*', 'versionEndIncluding': '0.8.15', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc6:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "Irssi before 0.8.15, when SSL is used, does not verify that the server hostname matches a domain name in the subject's Common Name (CN) field or a Subject Alternative Name field of the X.509 certificate, which allows man-in-the-middle attackers to spoof IRC servers via an arbitrary certificate."}]
2017-08-17T01:32Z
2010-04-16T19:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
coekie
2009-12-28 12:15:18+00:00
Check if an SSL certificate matches the hostname of the server we are connecting to git-svn-id: http://svn.irssi.org/repos/irssi/trunk@5104 dbcabf3a-b0e7-0310-adc4-f8d773084564
85bbc05b21678e80423815d2ef1dfe26208491ab
False
ensc/irssi-proxy
Native proxy support (socks5, http) for the irssi IRC client
2009-08-10 07:47:34
2010-04-07 07:51:46
ensc
2.0
2.0
net_connect_ip_ssl
net_connect_ip_ssl( IPADDR * ip , int port , IPADDR * my_ip , const char * cert , const char * pkey , const char * cafile , const char * capath , gboolean verify)
['ip', 'port', 'my_ip', 'cert', 'pkey', 'cafile', 'capath', 'verify']
GIOChannel *net_connect_ip_ssl(IPADDR *ip, int port, IPADDR *my_ip, const char *cert, const char *pkey, const char *cafile, const char *capath, gboolean verify) { GIOChannel *handle, *ssl_handle; handle = net_connect_ip(ip, port, my_ip); if (handle == NULL) return NULL; ssl_handle = irssi_ssl_get_iochannel(handle, cert, pkey, cafile, capath, verify); if (ssl_handle == NULL) g_io_channel_unref(handle); return ssl_handle; }
96
True
1
CVE-2010-1155
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.ubuntu.com/usn/USN-929-1', 'name': 'USN-929-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127116251220784&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/39365', 'name': '39365', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://irssi.org/news/ChangeLog', 'name': 'http://irssi.org/news/ChangeLog', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127110132019166&w=2', 'name': '[oss-security] 20100412 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0856', 'name': 'ADV-2010-0856', 'refsource': 'VUPEN', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'http://irssi.org/news', 'name': 'http://irssi.org/news', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'name': 'http://github.com/ensc/irssi-proxy/commit/85bbc05b21678e80423815d2ef1dfe26208491ab', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127119240204394&w=2', 'name': '[oss-security] 20100413 Re: CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://marc.info/?l=oss-security&m=127098845125270&w=2', 'name': '[oss-security] 20100411 CVE request: irssi 0.8.15', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://slackware.com/security/viewer.php?l=slackware-security&y=2010&m=slackware-security.497301', 'name': 'SSA:2010-116-01', 'refsource': 'SLACKWARE', 'tags': []}, {'url': 'http://secunia.com/advisories/39620', 'name': '39620', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/0987', 'name': 'ADV-2010-0987', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1110', 'name': 'ADV-2010-1110', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://secunia.com/advisories/39797', 'name': '39797', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://lists.fedoraproject.org/pipermail/package-announce/2010-May/041054.html', 'name': 'FEDORA-2010-6629', 'refsource': 'FEDORA', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2010/1107', 'name': 'ADV-2010-1107', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2010-05/msg00001.html', 'name': 'SUSE-SR:2010:011', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/57790', 'name': 'irssi-hostname-mitm(57790)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:*:rc1:*:*:*:*:*:*', 'versionEndIncluding': '0.8.15', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc8:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.13:rc1:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc5:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.11:rc2:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc7:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:irssi:irssi:0.8.10:rc6:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': "Irssi before 0.8.15, when SSL is used, does not verify that the server hostname matches a domain name in the subject's Common Name (CN) field or a Subject Alternative Name field of the X.509 certificate, which allows man-in-the-middle attackers to spoof IRC servers via an arbitrary certificate."}]
2017-08-17T01:32Z
2010-04-16T19:30Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
coekie
2009-12-28 12:15:18+00:00
Check if an SSL certificate matches the hostname of the server we are connecting to git-svn-id: http://svn.irssi.org/repos/irssi/trunk@5104 dbcabf3a-b0e7-0310-adc4-f8d773084564
85bbc05b21678e80423815d2ef1dfe26208491ab
False
ensc/irssi-proxy
Native proxy support (socks5, http) for the irssi IRC client
2009-08-10 07:47:34
2010-04-07 07:51:46
ensc
2.0
2.0
server_real_connect
server_real_connect( SERVER_REC * server , IPADDR * ip , const char * unix_socket)
['server', 'ip', 'unix_socket']
static void server_real_connect(SERVER_REC *server, IPADDR *ip, const char *unix_socket) { GIOChannel *handle; IPADDR *own_ip = NULL; const char *errmsg; char *errmsg2; char ipaddr[MAX_IP_LEN]; int port; g_return_if_fail(ip != NULL || unix_socket != NULL); signal_emit("server connecting", 2, server, ip); if (server->connrec->no_connect) return; if (ip != NULL) { own_ip = ip == NULL ? NULL : (IPADDR_IS_V6(ip) ? server->connrec->own_ip6 : server->connrec->own_ip4); port = server->connrec->proxy != NULL ? server->connrec->proxy_port : server->connrec->port; handle = server->connrec->use_ssl ? net_connect_ip_ssl(ip, port, own_ip, server->connrec->ssl_cert, server->connrec->ssl_pkey, server->connrec->ssl_cafile, server->connrec->ssl_capath, server->connrec->ssl_verify) : net_connect_ip(ip, port, own_ip); } else { handle = net_connect_unix(unix_socket); } if (handle == NULL) { /* failed */ errmsg = g_strerror(errno); errmsg2 = NULL; if (errno == EADDRNOTAVAIL) { if (own_ip != NULL) { /* show the IP which is causing the error */ net_ip2host(own_ip, ipaddr); errmsg2 = g_strconcat(errmsg, ": ", ipaddr, NULL); } server->no_reconnect = TRUE; } if (server->connrec->use_ssl && errno == ENOSYS) server->no_reconnect = TRUE; server->connection_lost = TRUE; server_connect_failed(server, errmsg2 ? errmsg2 : errmsg); g_free(errmsg2); } else { server->handle = net_sendbuffer_create(handle, 0); #ifdef HAVE_OPENSSL if (server->connrec->use_ssl) server_connect_callback_init_ssl(server, handle); else #endif server->connect_tag = g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ, (GInputFunction) server_connect_callback_init, server); } }
351
True
1
CVE-2010-2060
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.securityfocus.com/bid/40516', 'name': '40516', 'refsource': 'BID', 'tags': []}, {'url': 'http://secunia.com/advisories/40032', 'name': '40032', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://kr.github.com/beanstalkd/2010/05/23/1.4.6-release-notes.html', 'name': 'http://kr.github.com/beanstalkd/2010/05/23/1.4.6-release-notes.html', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://github.com/kr/beanstalkd/commit/2e8e8c6387ecdf5923dfc4d7718d18eba1b0873d', 'name': 'http://github.com/kr/beanstalkd/commit/2e8e8c6387ecdf5923dfc4d7718d18eba1b0873d', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://osvdb.org/65113', 'name': '65113', 'refsource': 'OSVDB', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/59107', 'name': 'beanstalkd-put-command-execution(59107)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.4.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:0.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.4.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:0.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:0.5:-:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.4.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.4.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:0.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:0.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:0.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wildbit:beanstalkd:1.4.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The put command functionality in beanstalkd 1.4.5 and earlier allows remote attackers to execute arbitrary Beanstalk commands via the body in a job that is too big, which is not properly handled by the dispatch_cmd function in prot.c.'}]
2017-08-17T01:32Z
2010-06-08T00:30Z
Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
Insufficient Information
https://nvd.nist.gov/vuln/categories
0
Keith Rarick
2010-05-23 00:13:28-07:00
Discard job body bytes if the job is too big. Previously, a malicious user could craft a job payload and inject beanstalk commands without the client application knowing. (An extra-careful client library could check the size of the job body before sending the put command, but most libraries do not do this, nor should they have to.) Reported by Graham Barr.
2e8e8c6387ecdf5923dfc4d7718d18eba1b0873d
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
kr
visit repo url
visit repo url
dispatch_cmd
dispatch_cmd( conn c)
['c']
dispatch_cmd(conn c) { int r, i, timeout = -1; size_t z; unsigned int count; job j; unsigned char type; char *size_buf, *delay_buf, *ttr_buf, *pri_buf, *end_buf, *name; unsigned int pri, body_size; usec delay, ttr; uint64_t id; tube t = NULL; /* NUL-terminate this string so we can use strtol and friends */ c->cmd[c->cmd_len - 2] = '\0'; /* check for possible maliciousness */ if (strlen(c->cmd) != c->cmd_len - 2) { return reply_msg(c, MSG_BAD_FORMAT); } type = which_cmd(c); dprintf("got %s command: \"%s\"\n", op_names[(int) type], c->cmd); switch (type) { case OP_PUT: r = read_pri(&pri, c->cmd + 4, &delay_buf); if (r) return reply_msg(c, MSG_BAD_FORMAT); r = read_delay(&delay, delay_buf, &ttr_buf); if (r) return reply_msg(c, MSG_BAD_FORMAT); r = read_ttr(&ttr, ttr_buf, &size_buf); if (r) return reply_msg(c, MSG_BAD_FORMAT); errno = 0; body_size = strtoul(size_buf, &end_buf, 10); if (errno) return reply_msg(c, MSG_BAD_FORMAT); if (body_size > job_data_size_limit) { return reply_msg(c, MSG_JOB_TOO_BIG); } /* don't allow trailing garbage */ if (end_buf[0] != '\0') return reply_msg(c, MSG_BAD_FORMAT); conn_set_producer(c); c->in_job = make_job(pri, delay, ttr ? : 1, body_size + 2, c->use); /* OOM? */ if (!c->in_job) { /* throw away the job body and respond with OUT_OF_MEMORY */ twarnx("server error: " MSG_OUT_OF_MEMORY); return skip(c, body_size + 2, MSG_OUT_OF_MEMORY); } fill_extra_data(c); /* it's possible we already have a complete job */ maybe_enqueue_incoming_job(c); break; case OP_PEEK_READY: /* don't allow trailing garbage */ if (c->cmd_len != CMD_PEEK_READY_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; j = job_copy(pq_peek(&c->use->ready)); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); reply_job(c, j, MSG_FOUND); break; case OP_PEEK_DELAYED: /* don't allow trailing garbage */ if (c->cmd_len != CMD_PEEK_DELAYED_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; j = job_copy(pq_peek(&c->use->delay)); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); reply_job(c, j, MSG_FOUND); break; case OP_PEEK_BURIED: /* don't allow trailing garbage */ if (c->cmd_len != CMD_PEEK_BURIED_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; j = job_copy(buried_job_p(c->use)? j = c->use->buried.next : NULL); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); reply_job(c, j, MSG_FOUND); break; case OP_PEEKJOB: errno = 0; id = strtoull(c->cmd + CMD_PEEKJOB_LEN, &end_buf, 10); if (errno) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; /* So, peek is annoying, because some other connection might free the * job while we are still trying to write it out. So we copy it and * then free the copy when it's done sending. */ j = job_copy(peek_job(id)); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); reply_job(c, j, MSG_FOUND); break; case OP_RESERVE_TIMEOUT: errno = 0; timeout = strtol(c->cmd + CMD_RESERVE_TIMEOUT_LEN, &end_buf, 10); if (errno) return reply_msg(c, MSG_BAD_FORMAT); case OP_RESERVE: /* FALLTHROUGH */ /* don't allow trailing garbage */ if (type == OP_RESERVE && c->cmd_len != CMD_RESERVE_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; conn_set_worker(c); if (conn_has_close_deadline(c) && !conn_ready(c)) { return reply_msg(c, MSG_DEADLINE_SOON); } /* try to get a new job for this guy */ wait_for_job(c, timeout); process_queue(); break; case OP_DELETE: errno = 0; id = strtoull(c->cmd + CMD_DELETE_LEN, &end_buf, 10); if (errno) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; j = job_find(id); j = remove_reserved_job(c, j) ? : remove_ready_job(j) ? : remove_buried_job(j); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); j->state = JOB_STATE_INVALID; r = binlog_write_job(j); job_free(j); if (!r) return reply_serr(c, MSG_INTERNAL_ERROR); reply(c, MSG_DELETED, MSG_DELETED_LEN, STATE_SENDWORD); break; case OP_RELEASE: errno = 0; id = strtoull(c->cmd + CMD_RELEASE_LEN, &pri_buf, 10); if (errno) return reply_msg(c, MSG_BAD_FORMAT); r = read_pri(&pri, pri_buf, &delay_buf); if (r) return reply_msg(c, MSG_BAD_FORMAT); r = read_delay(&delay, delay_buf, NULL); if (r) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; j = remove_reserved_job(c, job_find(id)); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); /* We want to update the delay deadline on disk, so reserve space for * that. */ if (delay) { z = binlog_reserve_space_update(j); if (!z) return reply_serr(c, MSG_OUT_OF_MEMORY); j->reserved_binlog_space += z; } j->pri = pri; j->delay = delay; j->release_ct++; r = enqueue_job(j, delay, !!delay); if (r < 0) return reply_serr(c, MSG_INTERNAL_ERROR); if (r == 1) { return reply(c, MSG_RELEASED, MSG_RELEASED_LEN, STATE_SENDWORD); } /* out of memory trying to grow the queue, so it gets buried */ bury_job(j, 0); reply(c, MSG_BURIED, MSG_BURIED_LEN, STATE_SENDWORD); break; case OP_BURY: errno = 0; id = strtoull(c->cmd + CMD_BURY_LEN, &pri_buf, 10); if (errno) return reply_msg(c, MSG_BAD_FORMAT); r = read_pri(&pri, pri_buf, NULL); if (r) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; j = remove_reserved_job(c, job_find(id)); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); j->pri = pri; r = bury_job(j, 1); if (!r) return reply_serr(c, MSG_INTERNAL_ERROR); reply(c, MSG_BURIED, MSG_BURIED_LEN, STATE_SENDWORD); break; case OP_KICK: errno = 0; count = strtoul(c->cmd + CMD_KICK_LEN, &end_buf, 10); if (end_buf == c->cmd + CMD_KICK_LEN) { return reply_msg(c, MSG_BAD_FORMAT); } if (errno) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; i = kick_jobs(c->use, count); return reply_line(c, STATE_SENDWORD, "KICKED %u\r\n", i); case OP_TOUCH: errno = 0; id = strtoull(c->cmd + CMD_TOUCH_LEN, &end_buf, 10); if (errno) return twarn("strtoull"), reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; j = touch_job(c, job_find(id)); if (j) { reply(c, MSG_TOUCHED, MSG_TOUCHED_LEN, STATE_SENDWORD); } else { return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); } break; case OP_STATS: /* don't allow trailing garbage */ if (c->cmd_len != CMD_STATS_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; do_stats(c, fmt_stats, NULL); break; case OP_JOBSTATS: errno = 0; id = strtoull(c->cmd + CMD_JOBSTATS_LEN, &end_buf, 10); if (errno) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; j = peek_job(id); if (!j) return reply(c, MSG_NOTFOUND, MSG_NOTFOUND_LEN, STATE_SENDWORD); if (!j->tube) return reply_serr(c, MSG_INTERNAL_ERROR); do_stats(c, (fmt_fn) fmt_job_stats, j); break; case OP_STATS_TUBE: name = c->cmd + CMD_STATS_TUBE_LEN; if (!name_is_ok(name, 200)) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; t = tube_find(name); if (!t) return reply_msg(c, MSG_NOTFOUND); do_stats(c, (fmt_fn) fmt_stats_tube, t); t = NULL; break; case OP_LIST_TUBES: /* don't allow trailing garbage */ if (c->cmd_len != CMD_LIST_TUBES_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; do_list_tubes(c, &tubes); break; case OP_LIST_TUBE_USED: /* don't allow trailing garbage */ if (c->cmd_len != CMD_LIST_TUBE_USED_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; reply_line(c, STATE_SENDWORD, "USING %s\r\n", c->use->name); break; case OP_LIST_TUBES_WATCHED: /* don't allow trailing garbage */ if (c->cmd_len != CMD_LIST_TUBES_WATCHED_LEN + 2) { return reply_msg(c, MSG_BAD_FORMAT); } op_ct[type]++; do_list_tubes(c, &c->watch); break; case OP_USE: name = c->cmd + CMD_USE_LEN; if (!name_is_ok(name, 200)) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; TUBE_ASSIGN(t, tube_find_or_make(name)); if (!t) return reply_serr(c, MSG_OUT_OF_MEMORY); c->use->using_ct--; TUBE_ASSIGN(c->use, t); TUBE_ASSIGN(t, NULL); c->use->using_ct++; reply_line(c, STATE_SENDWORD, "USING %s\r\n", c->use->name); break; case OP_WATCH: name = c->cmd + CMD_WATCH_LEN; if (!name_is_ok(name, 200)) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; TUBE_ASSIGN(t, tube_find_or_make(name)); if (!t) return reply_serr(c, MSG_OUT_OF_MEMORY); r = 1; if (!ms_contains(&c->watch, t)) r = ms_append(&c->watch, t); TUBE_ASSIGN(t, NULL); if (!r) return reply_serr(c, MSG_OUT_OF_MEMORY); reply_line(c, STATE_SENDWORD, "WATCHING %d\r\n", c->watch.used); break; case OP_IGNORE: name = c->cmd + CMD_IGNORE_LEN; if (!name_is_ok(name, 200)) return reply_msg(c, MSG_BAD_FORMAT); op_ct[type]++; t = NULL; for (i = 0; i < c->watch.used; i++) { t = c->watch.items[i]; if (strncmp(t->name, name, MAX_TUBE_NAME_LEN) == 0) break; t = NULL; } if (t && c->watch.used < 2) return reply_msg(c, MSG_NOT_IGNORED); if (t) ms_remove(&c->watch, t); /* may free t if refcount => 0 */ t = NULL; reply_line(c, STATE_SENDWORD, "WATCHING %d\r\n", c->watch.used); break; case OP_QUIT: conn_close(c); break; case OP_PAUSE_TUBE: op_ct[type]++; r = read_tube_name(&name, c->cmd + CMD_PAUSE_TUBE_LEN, &delay_buf); if (r) return reply_msg(c, MSG_BAD_FORMAT); r = read_delay(&delay, delay_buf, NULL); if (r) return reply_msg(c, MSG_BAD_FORMAT); *delay_buf = '\0'; t = tube_find(name); if (!t) return reply_msg(c, MSG_NOTFOUND); t->deadline_at = now_usec() + delay; t->pause = delay; t->stat.pause_ct++; set_main_delay_timeout(); reply_line(c, STATE_SENDWORD, "PAUSED\r\n"); break; default: return reply_msg(c, MSG_UNKNOWN_COMMAND); } }
2289
True
1
CVE-2010-3844
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://security-tracker.debian.org/tracker/CVE-2010-3844', 'name': 'https://security-tracker.debian.org/tracker/CVE-2010-3844', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2010-3844', 'name': 'https://access.redhat.com/security/cve/cve-2010-3844', 'refsource': 'MISC', 'tags': ['Broken Link', 'Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600130', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600130', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/Ettercap/ettercap/commit/4ef3ede30181eca9add74305ad26dbcb0c3686a0', 'name': 'https://github.com/Ettercap/ettercap/commit/4ef3ede30181eca9add74305ad26dbcb0c3686a0', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ettercap-project:ettercap:0.7.3:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An unchecked sscanf() call in ettercap before 0.7.5 allows an insecure temporary settings file to overflow a static-sized buffer on the stack.'}]
2020-02-26T13:35Z
2019-11-12T22:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
Emilio Escobar
2012-08-23 09:16:28-04:00
More changes to mitigate: CVE-2010-3843 CVE-2010-3844
4ef3ede30181eca9add74305ad26dbcb0c3686a0
False
Ettercap/ettercap
Ettercap Project
2012-07-14 02:50:27
2022-07-02 21:45:00
http://www.ettercap-project.org
Ettercap
1885.0
460.0
gtkui_conf_read
gtkui_conf_read( void)
['void']
void gtkui_conf_read(void) { FILE *fd; const char *path; char line[100], name[30]; short value; #ifdef OS_WINDOWS path = ec_win_get_user_dir(); #else /* TODO: get the dopped privs home dir instead of "/root" */ /* path = g_get_home_dir(); */ path = g_get_tmp_dir(); #endif filename = g_build_filename(path, ".ettercap_gtk", NULL); DEBUG_MSG("gtkui_conf_read: %s", filename); fd = fopen(filename, "r"); if(!fd) return; while(fgets(line, 100, fd)) { sscanf(line, "%s = %hd", name, &value); gtkui_conf_set(name, value); } fclose(fd); }
112
True
1
CVE-2010-3844
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://security-tracker.debian.org/tracker/CVE-2010-3844', 'name': 'https://security-tracker.debian.org/tracker/CVE-2010-3844', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2010-3844', 'name': 'https://access.redhat.com/security/cve/cve-2010-3844', 'refsource': 'MISC', 'tags': ['Broken Link', 'Third Party Advisory']}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600130', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600130', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/Ettercap/ettercap/commit/4ef3ede30181eca9add74305ad26dbcb0c3686a0', 'name': 'https://github.com/Ettercap/ettercap/commit/4ef3ede30181eca9add74305ad26dbcb0c3686a0', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-120'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ettercap-project:ettercap:0.7.3:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An unchecked sscanf() call in ettercap before 0.7.5 allows an insecure temporary settings file to overflow a static-sized buffer on the stack.'}]
2020-02-26T13:35Z
2019-11-12T22:15Z
Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
https://cwe.mitre.org/data/definitions/120.html
0
Emilio Escobar
2012-08-23 09:16:28-04:00
More changes to mitigate: CVE-2010-3843 CVE-2010-3844
4ef3ede30181eca9add74305ad26dbcb0c3686a0
False
Ettercap/ettercap
Ettercap Project
2012-07-14 02:50:27
2022-07-02 21:45:00
http://www.ettercap-project.org
Ettercap
1885.0
460.0
gtkui_icmp_redir
gtkui_icmp_redir( void)
['void']
void gtkui_icmp_redir(void) { GtkWidget *dialog, *table, *hbox, *image, *label, *entry1, *entry2, *frame; gint response = 0; DEBUG_MSG("gtk_icmp_redir"); dialog = gtk_dialog_new_with_buttons("MITM Attack: ICMP Redirect", GTK_WINDOW (window), GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_OK, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); gtk_container_set_border_width(GTK_CONTAINER (dialog), 5); gtk_dialog_set_has_separator(GTK_DIALOG (dialog), FALSE); hbox = gtk_hbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0); gtk_widget_show(hbox); image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.1); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 5); gtk_widget_show(image); frame = gtk_frame_new("Gateway Information"); gtk_container_set_border_width(GTK_CONTAINER (frame), 5); gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); table = gtk_table_new(2, 2, FALSE); gtk_table_set_row_spacings(GTK_TABLE (table), 5); gtk_table_set_col_spacings(GTK_TABLE (table), 5); gtk_container_set_border_width(GTK_CONTAINER (table), 8); gtk_container_add(GTK_CONTAINER (frame), table); gtk_widget_show(table); label = gtk_label_new("MAC Address"); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); gtk_table_attach(GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show(label); entry1 = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY (entry1), ETH_ASCII_ADDR_LEN); gtk_table_attach_defaults(GTK_TABLE (table), entry1, 1, 2, 0, 1); gtk_widget_show(entry1); label = gtk_label_new("IP Address"); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); gtk_table_attach(GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show(label); entry2 = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY (entry2), IP6_ASCII_ADDR_LEN); gtk_table_attach_defaults(GTK_TABLE (table), entry2, 1, 2, 1, 2); gtk_widget_show(entry2); response = gtk_dialog_run(GTK_DIALOG(dialog)); if(response == GTK_RESPONSE_OK) { gtk_widget_hide(dialog); snprintf(params, 6, "icmp:"); strncat(params, gtk_entry_get_text(GTK_ENTRY(entry1)), PARAMS_LEN); strncat(params, "/", PARAMS_LEN); strncat(params, gtk_entry_get_text(GTK_ENTRY(entry2)), PARAMS_LEN); gtkui_start_mitm(); } gtk_widget_destroy(dialog); /* a simpler method: gtkui_input_call("Parameters :", params + strlen("icmp:"), PARAMS_LEN - strlen("icmp:"), gtkui_start_mitm); */ }
522
True
1
CVE-2014-6395
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'https://www.obrela.com/home/security-labs/advisories/osi-advisory-osi-1402/', 'name': 'https://www.obrela.com/home/security-labs/advisories/osi-advisory-osi-1402/', 'refsource': 'MISC', 'tags': []}, {'url': 'https://github.com/Ettercap/ettercap/commit/e3abe7d7585ecc420a7cab73313216613aadad5a', 'name': 'https://github.com/Ettercap/ettercap/commit/e3abe7d7585ecc420a7cab73313216613aadad5a', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/201505-01', 'name': 'GLSA-201505-01', 'refsource': 'GENTOO', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/71689', 'name': '71689', 'refsource': 'BID', 'tags': []}, {'url': 'http://www.securityfocus.com/archive/1/534248/100/0/threaded', 'name': '20141216 "Ettercap 8.0 - 8.1" multiple vulnerabilities', 'refsource': 'BUGTRAQ', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ettercap-project:ettercap:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.8.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Heap-based buffer overflow in the dissector_postgresql function in dissectors/ec_postgresql.c in Ettercap before 0.8.1 allows remote attackers to cause a denial of service or possibly execute arbitrary code via a crafted password length value that is inconsistent with the actual length of the password.'}]
2020-02-26T13:35Z
2014-12-19T15:59Z
Improper Restriction of Operations within the Bounds of a Memory Buffer
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. 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.
https://cwe.mitre.org/data/definitions/119.html
0
NickSampanis
2014-09-03 13:59:51+03:00
Fixed heap overflow caused by length
e3abe7d7585ecc420a7cab73313216613aadad5a
False
Ettercap/ettercap
Ettercap Project
2012-07-14 02:50:27
2022-07-02 21:45:00
http://www.ettercap-project.org
Ettercap
1885.0
460.0
FUNC_DECODER
FUNC_DECODER( dissector_postgresql)
['dissector_postgresql']
FUNC_DECODER(dissector_postgresql) { DECLARE_DISP_PTR(ptr); struct ec_session *s = NULL; void *ident = NULL; char tmp[MAX_ASCII_ADDR_LEN]; struct postgresql_status *conn_status; /* don't complain about unused var */ (void) DECODE_DATA; (void) DECODE_DATALEN; (void) DECODED_LEN; if (FROM_CLIENT("postgresql", PACKET)) { if (PACKET->DATA.len < 4) return NULL; dissect_create_ident(&ident, PACKET, DISSECT_CODE(dissector_postgresql)); /* if the session does not exist... */ if (session_get(&s, ident, DISSECT_IDENT_LEN) == -ENOTFOUND) { /* search for user and database strings, look for StartupMessage */ unsigned char *u = memmem(ptr, PACKET->DATA.len, "user", 4); unsigned char *d = memmem(ptr, PACKET->DATA.len, "database", 8); if (!memcmp(ptr + 4, "\x00\x03\x00\x00", 4) && u && d) { /* create the new session */ dissect_create_session(&s, PACKET, DISSECT_CODE(dissector_postgresql)); /* remember the state (used later) */ SAFE_CALLOC(s->data, 1, sizeof(struct postgresql_status)); conn_status = (struct postgresql_status *) s->data; conn_status->status = WAIT_AUTH; /* user is always null-terminated */ strncpy((char*)conn_status->user, (char*)(u + 5), 65); conn_status->user[64] = 0; /* database is always null-terminated */ strncpy((char*)conn_status->database, (char*)(d + 9), 65); conn_status->database[64] = 0; /* save the session */ session_put(s); } } else { conn_status = (struct postgresql_status *) s->data; if (conn_status->status == WAIT_RESPONSE) { /* check for PasswordMessage packet */ if (ptr[0] == 'p' && conn_status->type == MD5) { DEBUG_MSG("\tDissector_postgresql RESPONSE type is MD5"); if(memcmp(ptr + 1, "\x00\x00\x00\x28", 4)) { DEBUG_MSG("\tDissector_postgresql BUG, expected length is 40"); return NULL; } if (PACKET->DATA.len < 40) { DEBUG_MSG("\tDissector_postgresql BUG, expected length is 40"); return NULL; } memcpy(conn_status->hash, ptr + 5 + 3, 32); conn_status->hash[32] = 0; DISSECT_MSG("%s:$postgres$%s*%s*%s:%s:%d\n", conn_status->user, conn_status->user, conn_status->salt, conn_status->hash, ip_addr_ntoa(&PACKET->L3.dst, tmp), ntohs(PACKET->L4.dst)); dissect_wipe_session(PACKET, DISSECT_CODE(dissector_postgresql)); } else if (ptr[0] == 'p' && conn_status->type == CT) { int length; DEBUG_MSG("\tDissector_postgresql RESPONSE type is clear-text!"); GET_ULONG_BE(length, ptr, 1); strncpy((char*)conn_status->password, (char*)(ptr + 5), length - 4); conn_status->password[length - 4] = 0; DISSECT_MSG("PostgreSQL credentials:%s-%d:%s:%s\n", ip_addr_ntoa(&PACKET->L3.dst, tmp), ntohs(PACKET->L4.dst), conn_status->user, conn_status->password); dissect_wipe_session(PACKET, DISSECT_CODE(dissector_postgresql)); } } } } else { /* Packets coming from the server */ if (PACKET->DATA.len < 9) return NULL; dissect_create_ident(&ident, PACKET, DISSECT_CODE(dissector_postgresql)); if (session_get(&s, ident, DISSECT_IDENT_LEN) == ESUCCESS) { conn_status = (struct postgresql_status *) s->data; if (conn_status->status == WAIT_AUTH && ptr[0] == 'R' && !memcmp(ptr + 1, "\x00\x00\x00\x0c", 4) && !memcmp(ptr + 5, "\x00\x00\x00\x05", 4)) { conn_status->status = WAIT_RESPONSE; conn_status->type = MD5; DEBUG_MSG("\tDissector_postgresql AUTH type is MD5"); hex_encode(ptr + 9, 4, conn_status->salt); /* save salt */ } else if (conn_status->status == WAIT_AUTH && ptr[0] == 'R' && !memcmp(ptr + 1, "\x00\x00\x00\x08", 4) && !memcmp(ptr + 5, "\x00\x00\x00\x03", 4)) { conn_status->status = WAIT_RESPONSE; conn_status->type = CT; DEBUG_MSG("\tDissector_postgresql AUTH type is clear-text!"); } } } SAFE_FREE(ident); return NULL; }
752
True
1
CVE-2014-6396
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'https://www.obrela.com/home/security-labs/advisories/osi-advisory-osi-1402/', 'name': 'https://www.obrela.com/home/security-labs/advisories/osi-advisory-osi-1402/', 'refsource': 'MISC', 'tags': []}, {'url': 'https://github.com/Ettercap/ettercap/commit/e3abe7d7585ecc420a7cab73313216613aadad5a', 'name': 'https://github.com/Ettercap/ettercap/commit/e3abe7d7585ecc420a7cab73313216613aadad5a', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/201505-01', 'name': 'GLSA-201505-01', 'refsource': 'GENTOO', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/71697', 'name': '71697', 'refsource': 'BID', 'tags': []}, {'url': 'http://www.securityfocus.com/archive/1/534248/100/0/threaded', 'name': '20141216 "Ettercap 8.0 - 8.1" multiple vulnerabilities', 'refsource': 'BUGTRAQ', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ettercap-project:ettercap:*:*:*:*:*:*:*:*', 'versionEndIncluding': '0.8.0', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The dissector_postgresql function in dissectors/ec_postgresql.c in Ettercap before 0.8.1 allows remote attackers to cause a denial of service and possibly execute arbitrary code via a crafted password length, which triggers a 0 character to be written to an arbitrary memory location.'}]
2020-02-26T13:35Z
2014-12-19T15:59Z
Improper Restriction of Operations within the Bounds of a Memory Buffer
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. 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.
https://cwe.mitre.org/data/definitions/119.html
0
NickSampanis
2014-09-03 13:59:51+03:00
Fixed heap overflow caused by length
e3abe7d7585ecc420a7cab73313216613aadad5a
False
Ettercap/ettercap
Ettercap Project
2012-07-14 02:50:27
2022-07-02 21:45:00
http://www.ettercap-project.org
Ettercap
1885.0
460.0
FUNC_DECODER
FUNC_DECODER( dissector_postgresql)
['dissector_postgresql']
FUNC_DECODER(dissector_postgresql) { DECLARE_DISP_PTR(ptr); struct ec_session *s = NULL; void *ident = NULL; char tmp[MAX_ASCII_ADDR_LEN]; struct postgresql_status *conn_status; /* don't complain about unused var */ (void) DECODE_DATA; (void) DECODE_DATALEN; (void) DECODED_LEN; if (FROM_CLIENT("postgresql", PACKET)) { if (PACKET->DATA.len < 4) return NULL; dissect_create_ident(&ident, PACKET, DISSECT_CODE(dissector_postgresql)); /* if the session does not exist... */ if (session_get(&s, ident, DISSECT_IDENT_LEN) == -ENOTFOUND) { /* search for user and database strings, look for StartupMessage */ unsigned char *u = memmem(ptr, PACKET->DATA.len, "user", 4); unsigned char *d = memmem(ptr, PACKET->DATA.len, "database", 8); if (!memcmp(ptr + 4, "\x00\x03\x00\x00", 4) && u && d) { /* create the new session */ dissect_create_session(&s, PACKET, DISSECT_CODE(dissector_postgresql)); /* remember the state (used later) */ SAFE_CALLOC(s->data, 1, sizeof(struct postgresql_status)); conn_status = (struct postgresql_status *) s->data; conn_status->status = WAIT_AUTH; /* user is always null-terminated */ strncpy((char*)conn_status->user, (char*)(u + 5), 65); conn_status->user[64] = 0; /* database is always null-terminated */ strncpy((char*)conn_status->database, (char*)(d + 9), 65); conn_status->database[64] = 0; /* save the session */ session_put(s); } } else { conn_status = (struct postgresql_status *) s->data; if (conn_status->status == WAIT_RESPONSE) { /* check for PasswordMessage packet */ if (ptr[0] == 'p' && conn_status->type == MD5) { DEBUG_MSG("\tDissector_postgresql RESPONSE type is MD5"); if(memcmp(ptr + 1, "\x00\x00\x00\x28", 4)) { DEBUG_MSG("\tDissector_postgresql BUG, expected length is 40"); return NULL; } if (PACKET->DATA.len < 40) { DEBUG_MSG("\tDissector_postgresql BUG, expected length is 40"); return NULL; } memcpy(conn_status->hash, ptr + 5 + 3, 32); conn_status->hash[32] = 0; DISSECT_MSG("%s:$postgres$%s*%s*%s:%s:%d\n", conn_status->user, conn_status->user, conn_status->salt, conn_status->hash, ip_addr_ntoa(&PACKET->L3.dst, tmp), ntohs(PACKET->L4.dst)); dissect_wipe_session(PACKET, DISSECT_CODE(dissector_postgresql)); } else if (ptr[0] == 'p' && conn_status->type == CT) { int length; DEBUG_MSG("\tDissector_postgresql RESPONSE type is clear-text!"); GET_ULONG_BE(length, ptr, 1); strncpy((char*)conn_status->password, (char*)(ptr + 5), length - 4); conn_status->password[length - 4] = 0; DISSECT_MSG("PostgreSQL credentials:%s-%d:%s:%s\n", ip_addr_ntoa(&PACKET->L3.dst, tmp), ntohs(PACKET->L4.dst), conn_status->user, conn_status->password); dissect_wipe_session(PACKET, DISSECT_CODE(dissector_postgresql)); } } } } else { /* Packets coming from the server */ if (PACKET->DATA.len < 9) return NULL; dissect_create_ident(&ident, PACKET, DISSECT_CODE(dissector_postgresql)); if (session_get(&s, ident, DISSECT_IDENT_LEN) == ESUCCESS) { conn_status = (struct postgresql_status *) s->data; if (conn_status->status == WAIT_AUTH && ptr[0] == 'R' && !memcmp(ptr + 1, "\x00\x00\x00\x0c", 4) && !memcmp(ptr + 5, "\x00\x00\x00\x05", 4)) { conn_status->status = WAIT_RESPONSE; conn_status->type = MD5; DEBUG_MSG("\tDissector_postgresql AUTH type is MD5"); hex_encode(ptr + 9, 4, conn_status->salt); /* save salt */ } else if (conn_status->status == WAIT_AUTH && ptr[0] == 'R' && !memcmp(ptr + 1, "\x00\x00\x00\x08", 4) && !memcmp(ptr + 5, "\x00\x00\x00\x03", 4)) { conn_status->status = WAIT_RESPONSE; conn_status->type = CT; DEBUG_MSG("\tDissector_postgresql AUTH type is clear-text!"); } } } SAFE_FREE(ident); return NULL; }
752
True
1
CVE-2011-0991
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'https://github.com/mono/mono/commit/3f8ee42b8c867d9a4c18c22657840d072cca5c3a', 'name': 'https://github.com/mono/mono/commit/3f8ee42b8c867d9a4c18c22657840d072cca5c3a', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/44076', 'name': '44076', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2011-04/msg00024.html', 'name': '[opensuse-updates] 20110408 openSUSE-SU-2011:0313-1 (critical): moonlight security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/44002', 'name': '44002', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://www.vupen.com/english/advisories/2011/0904', 'name': 'ADV-2011-0904', 'refsource': 'VUPEN', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/mono/mono/commit/89d1455a80ef13cddee5d79ec00c06055da3085c', 'name': 'https://github.com/mono/mono/commit/89d1455a80ef13cddee5d79ec00c06055da3085c', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2011/04/06/14', 'name': '[oss-security] 20110406 Moonlight release 2.4.1 with security fixes', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://www.mono-project.com/Vulnerabilities', 'name': 'http://www.mono-project.com/Vulnerabilities', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://bugzilla.novell.com/show_bug.cgi?id=660422', 'name': 'https://bugzilla.novell.com/show_bug.cgi?id=660422', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/47208', 'name': '47208', 'refsource': 'BID', 'tags': []}, {'url': 'https://bugzilla.novell.com/show_bug.cgi?id=667077', 'name': 'https://bugzilla.novell.com/show_bug.cgi?id=667077', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'https://github.com/mono/mono/commit/8eb1189099e02372fd45ca1c67230eccf1edddc0', 'name': 'https://github.com/mono/mono/commit/8eb1189099e02372fd45ca1c67230eccf1edddc0', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/66626', 'name': 'momo-dynamicmethod-code-execution(66626)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-399'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:3.99:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mono:mono:*:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Use-after-free vulnerability in Mono, when Moonlight 2.x before 2.4.1 or 3.x before 3.99.3 is used, allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors related to finalizing and then resurrecting a DynamicMethod instance.'}]
2017-08-17T01:33Z
2011-04-13T21:55Z
Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
https://cwe.mitre.org/data/definitions/399.html
1
Rodrigo Kumpera
2011-02-01 16:50:24+01:00
Don't use finalization to cleanup dynamic methods. * reflection.c: Use a reference queue to cleanup dynamic methods instead of finalization. * runtime.c: Shutdown the dynamic method queue before runtime cleanup begins. * DynamicMethod.cs: No longer finalizable. * icall-def.h: Remove unused dynamic method icall. Fixes #660422
89d1455a80ef13cddee5d79ec00c06055da3085c
False
mono/mono
Mono open source ECMA CLI, C# and .NET implementation.
2010-07-22 18:06:36
2022-08-25 00:47:21
https://www.mono-project.com
mono
10019.0
3721.0
mono_reflection_create_dynamic_method
mono_reflection_create_dynamic_method( MonoReflectionDynamicMethod * mb)
['mb']
void mono_reflection_create_dynamic_method (MonoReflectionDynamicMethod *mb) { ReflectionMethodBuilder rmb; MonoMethodSignature *sig; MonoClass *klass; GSList *l; int i; sig = dynamic_method_to_signature (mb); reflection_methodbuilder_from_dynamic_method (&rmb, mb); /* * Resolve references. */ /* * Every second entry in the refs array is reserved for storing handle_class, * which is needed by the ldtoken implementation in the JIT. */ rmb.nrefs = mb->nrefs; rmb.refs = g_new0 (gpointer, mb->nrefs + 1); for (i = 0; i < mb->nrefs; i += 2) { MonoClass *handle_class; gpointer ref; MonoObject *obj = mono_array_get (mb->refs, MonoObject*, i); if (strcmp (obj->vtable->klass->name, "DynamicMethod") == 0) { MonoReflectionDynamicMethod *method = (MonoReflectionDynamicMethod*)obj; /* * The referenced DynamicMethod should already be created by the managed * code, except in the case of circular references. In that case, we store * method in the refs array, and fix it up later when the referenced * DynamicMethod is created. */ if (method->mhandle) { ref = method->mhandle; } else { /* FIXME: GC object stored in unmanaged memory */ ref = method; /* FIXME: GC object stored in unmanaged memory */ method->referenced_by = g_slist_append (method->referenced_by, mb); } handle_class = mono_defaults.methodhandle_class; } else { MonoException *ex = NULL; ref = resolve_object (mb->module->image, obj, &handle_class, NULL); if (!ref) ex = mono_get_exception_type_load (NULL, NULL); else if (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR) ex = mono_security_core_clr_ensure_dynamic_method_resolved_object (ref, handle_class); if (ex) { g_free (rmb.refs); mono_raise_exception (ex); return; } } rmb.refs [i] = ref; /* FIXME: GC object stored in unmanaged memory (change also resolve_object() signature) */ rmb.refs [i + 1] = handle_class; } klass = mb->owner ? mono_class_from_mono_type (mono_reflection_type_get_handle ((MonoReflectionType*)mb->owner)) : mono_defaults.object_class; mb->mhandle = reflection_methodbuilder_to_mono_method (klass, &rmb, sig); /* Fix up refs entries pointing at us */ for (l = mb->referenced_by; l; l = l->next) { MonoReflectionDynamicMethod *method = (MonoReflectionDynamicMethod*)l->data; MonoMethodWrapper *wrapper = (MonoMethodWrapper*)method->mhandle; gpointer *data; g_assert (method->mhandle); data = (gpointer*)wrapper->method_data; for (i = 0; i < GPOINTER_TO_UINT (data [0]); i += 2) { if ((data [i + 1] == mb) && (data [i + 1 + 1] == mono_defaults.methodhandle_class)) data [i + 1] = mb->mhandle; } } g_slist_free (mb->referenced_by); g_free (rmb.refs); /* ilgen is no longer needed */ mb->ilgen = NULL;
455
True
1
CVE-2011-0991
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'https://github.com/mono/mono/commit/3f8ee42b8c867d9a4c18c22657840d072cca5c3a', 'name': 'https://github.com/mono/mono/commit/3f8ee42b8c867d9a4c18c22657840d072cca5c3a', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/44076', 'name': '44076', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-updates/2011-04/msg00024.html', 'name': '[opensuse-updates] 20110408 openSUSE-SU-2011:0313-1 (critical): moonlight security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/44002', 'name': '44002', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'http://www.vupen.com/english/advisories/2011/0904', 'name': 'ADV-2011-0904', 'refsource': 'VUPEN', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/mono/mono/commit/89d1455a80ef13cddee5d79ec00c06055da3085c', 'name': 'https://github.com/mono/mono/commit/89d1455a80ef13cddee5d79ec00c06055da3085c', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2011/04/06/14', 'name': '[oss-security] 20110406 Moonlight release 2.4.1 with security fixes', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://www.mono-project.com/Vulnerabilities', 'name': 'http://www.mono-project.com/Vulnerabilities', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'https://bugzilla.novell.com/show_bug.cgi?id=660422', 'name': 'https://bugzilla.novell.com/show_bug.cgi?id=660422', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/47208', 'name': '47208', 'refsource': 'BID', 'tags': []}, {'url': 'https://bugzilla.novell.com/show_bug.cgi?id=667077', 'name': 'https://bugzilla.novell.com/show_bug.cgi?id=667077', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'https://github.com/mono/mono/commit/8eb1189099e02372fd45ca1c67230eccf1edddc0', 'name': 'https://github.com/mono/mono/commit/8eb1189099e02372fd45ca1c67230eccf1edddc0', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/66626', 'name': 'momo-dynamicmethod-code-execution(66626)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-399'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:3.99:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mono:mono:*:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Use-after-free vulnerability in Mono, when Moonlight 2.x before 2.4.1 or 3.x before 3.99.3 is used, allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors related to finalizing and then resurrecting a DynamicMethod instance.'}]
2017-08-17T01:33Z
2011-04-13T21:55Z
Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
https://cwe.mitre.org/data/definitions/399.html
1
Rodrigo Kumpera
2011-02-01 16:50:24+01:00
Don't use finalization to cleanup dynamic methods. * reflection.c: Use a reference queue to cleanup dynamic methods instead of finalization. * runtime.c: Shutdown the dynamic method queue before runtime cleanup begins. * DynamicMethod.cs: No longer finalizable. * icall-def.h: Remove unused dynamic method icall. Fixes #660422
89d1455a80ef13cddee5d79ec00c06055da3085c
False
mono/mono
Mono open source ECMA CLI, C# and .NET implementation.
2010-07-22 18:06:36
2022-08-25 00:47:21
https://www.mono-project.com
mono
10019.0
3721.0
mono_reflection_destroy_dynamic_method
mono_reflection_destroy_dynamic_method( MonoReflectionDynamicMethod * mb)
['mb']
void mono_reflection_destroy_dynamic_method (MonoReflectionDynamicMethod *mb) { g_assert (mb); if (mb->mhandle) mono_runtime_free_method ( mono_object_get_domain ((MonoObject*)mb), mb->mhandle);
35
True
1
CVE-2011-0992
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:N/A:P
NETWORK
MEDIUM
NONE
PARTIAL
NONE
PARTIAL
5.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.securityfocus.com/bid/47208', 'name': '47208', 'refsource': 'BID', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-updates/2011-04/msg00024.html', 'name': '[opensuse-updates] 20110408 openSUSE-SU-2011:0313-1 (critical): moonlight security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.mono-project.com/Vulnerabilities', 'name': 'http://www.mono-project.com/Vulnerabilities', 'refsource': 'CONFIRM', 'tags': ['Vendor Advisory']}, {'url': 'http://secunia.com/advisories/44076', 'name': '44076', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'https://bugzilla.novell.com/show_bug.cgi?id=667077', 'name': 'https://bugzilla.novell.com/show_bug.cgi?id=667077', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=694933', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=694933', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'https://github.com/mono/mono/commit/722f9890f09aadfc37ae479e7d946d5fc5ef7b91', 'name': 'https://github.com/mono/mono/commit/722f9890f09aadfc37ae479e7d946d5fc5ef7b91', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2011/04/06/14', 'name': '[oss-security] 20110406 Moonlight release 2.4.1 with security fixes', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://www.vupen.com/english/advisories/2011/0904', 'name': 'ADV-2011-0904', 'refsource': 'VUPEN', 'tags': ['Vendor Advisory']}, {'url': 'https://bugzilla.novell.com/show_bug.cgi?id=678515', 'name': 'https://bugzilla.novell.com/show_bug.cgi?id=678515', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://secunia.com/advisories/44002', 'name': '44002', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/66627', 'name': 'momo-monothread-info-disclosure(66627)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-399'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:3.99:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:mono:mono:*:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:novell:moonlight:2.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Use-after-free vulnerability in Mono, when Moonlight 2.x before 2.4.1 or 3.x before 3.99.3 is used, allows remote attackers to cause a denial of service (plugin crash) or obtain sensitive information via vectors related to member data in a resurrected MonoThread instance.'}]
2017-08-17T01:33Z
2011-04-13T21:55Z
Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
https://cwe.mitre.org/data/definitions/399.html
1
Sebastien Pouliot
2011-04-06 13:24:31-04:00
Fix access to freed members of a dead thread * threads.c: Fix access to freed members of a dead thread. Found and fixed by Rodrigo Kumpera <[email protected]> Ref: CVE-2011-0992
722f9890f09aadfc37ae479e7d946d5fc5ef7b91
False
mono/mono
Mono open source ECMA CLI, C# and .NET implementation.
2010-07-22 18:06:36
2022-08-25 00:47:21
https://www.mono-project.com
mono
10019.0
3721.0
ves_icall_System_Threading_InternalThread_Thread_free_internal
ves_icall_System_Threading_InternalThread_Thread_free_internal( MonoInternalThread * this , HANDLE thread)
['this', 'thread']
void ves_icall_System_Threading_InternalThread_Thread_free_internal (MonoInternalThread *this, HANDLE thread) { MONO_ARCH_SAVE_REGS; THREAD_DEBUG (g_message ("%s: Closing thread %p, handle %p", __func__, this, thread)); if (thread) CloseHandle (thread); if (this->synch_cs) { DeleteCriticalSection (this->synch_cs); g_free (this->synch_cs); this->synch_cs = NULL; } g_free (this->name); }
71
True
1
CVE-2013-7441
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:C
NETWORK
LOW
NONE
NONE
NONE
COMPLETE
7.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://www.openwall.com/lists/oss-security/2015/05/21/5', 'name': '[oss-security] 20150521 Re: CVE Request: nbd denial of service', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.openwall.com/lists/oss-security/2015/05/19/6', 'name': '[oss-security] 20150519 CVE Request: nbd denial of service', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781547', 'name': 'https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781547', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://github.com/yoe/nbd/commit/741495cb08503fd32a9d22648e63b64390c601f4', 'name': 'https://github.com/yoe/nbd/commit/741495cb08503fd32a9d22648e63b64390c601f4', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://sourceforge.net/p/nbd/mailman/message/30410146/', 'name': '[Nbd] 20130128 NBD server terminates on SIGPIPE during negotiation', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.debian.org/security/2015/dsa-3271', 'name': 'DSA-3271', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://www.ubuntu.com/usn/USN-2676-1', 'name': 'USN-2676-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/74808', 'name': '74808', 'refsource': 'BID', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-updates/2015-06/msg00003.html', 'name': 'openSUSE-SU-2015:0994', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-399'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.25:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:3.1.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:3.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:3.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.22:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.23:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.24:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:3.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.5:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The modern style negotiation in Network Block Device (nbd-server) 2.9.22 through 3.3 allows remote attackers to cause a denial of service (root process termination) by (1) closing the connection during negotiation or (2) specifying a name for a non-existent export.'}]
2016-12-31T02:59Z
2015-05-29T15:59Z
Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
https://cwe.mitre.org/data/definitions/399.html
1
Tuomas Räsänen
2013-06-05 20:42:31+03:00
nbd-server: handle modern-style negotiation in a child process Previously, the modern style negotiation was carried out in the root server (listener) process before forking the actual client handler. This made it possible for a malfunctioning or evil client to terminate the root process simply by querying a non-existent export or aborting in the middle of the negotation process (caused SIGPIPE in the server). This commit moves the negotiation process to the child to keep the root process up and running no matter what happens during the negotiation. See http://sourceforge.net/mailarchive/message.php?msg_id=30410146 Signed-off-by: Tuomas Räsänen <[email protected]>
741495cb08503fd32a9d22648e63b64390c601f4
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
yoe
visit repo url
visit repo url
serveloop
serveloop( GArray * servers)
['servers']
void serveloop(GArray* servers) { struct sockaddr_storage addrin; socklen_t addrinlen=sizeof(addrin); int i; int max; fd_set mset; fd_set rset; /* * Set up the master fd_set. The set of descriptors we need * to select() for never changes anyway and it buys us a *lot* * of time to only build this once. However, if we ever choose * to not fork() for clients anymore, we may have to revisit * this. */ max=0; FD_ZERO(&mset); for(i=0;i<servers->len;i++) { int sock; if((sock=(g_array_index(servers, SERVER, i)).socket) >= 0) { FD_SET(sock, &mset); max=sock>max?sock:max; } } for(i=0;i<modernsocks->len;i++) { int sock = g_array_index(modernsocks, int, i); FD_SET(sock, &mset); max=sock>max?sock:max; } for(;;) { /* SIGHUP causes the root server process to reconfigure * itself and add new export servers for each newly * found export configuration group, i.e. spawn new * server processes for each previously non-existent * export. This does not alter old runtime configuration * but just appends new exports. */ if (is_sighup_caught) { int n; GError *gerror = NULL; msg(LOG_INFO, "reconfiguration request received"); is_sighup_caught = 0; /* Reset to allow catching * it again. */ n = append_new_servers(servers, &gerror); if (n == -1) msg(LOG_ERR, "failed to append new servers: %s", gerror->message); for (i = servers->len - n; i < servers->len; ++i) { const SERVER server = g_array_index(servers, SERVER, i); if (server.socket >= 0) { FD_SET(server.socket, &mset); max = server.socket > max ? server.socket : max; } msg(LOG_INFO, "reconfigured new server: %s", server.servename); } } memcpy(&rset, &mset, sizeof(fd_set)); if(select(max+1, &rset, NULL, NULL, NULL)>0) { int net; DEBUG("accept, "); for(i=0; i < modernsocks->len; i++) { int sock = g_array_index(modernsocks, int, i); if(!FD_ISSET(sock, &rset)) { continue; } CLIENT *client; if((net=accept(sock, (struct sockaddr *) &addrin, &addrinlen)) < 0) { err_nonfatal("accept: %m"); continue; } client = negotiate(net, NULL, servers, NEG_INIT | NEG_MODERN); if(!client) { close(net); continue; } handle_connection(servers, net, client->server, client); } for(i=0; i < servers->len; i++) { SERVER *serve; serve=&(g_array_index(servers, SERVER, i)); if(serve->socket < 0) { continue; } if(FD_ISSET(serve->socket, &rset)) { if ((net=accept(serve->socket, (struct sockaddr *) &addrin, &addrinlen)) < 0) { err_nonfatal("accept: %m"); continue; } handle_connection(servers, net, serve, NULL); } } } } }
564
True
1
CVE-2011-0530
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://lists.fedoraproject.org/pipermail/package-announce/2011-February/054083.html', 'name': 'FEDORA-2011-1108', 'refsource': 'FEDORA', 'tags': ['Patch']}, {'url': 'http://openwall.com/lists/oss-security/2011/01/31/7', 'name': '[oss-security] 20110131 Re: CVE Request -- NDB: CVE-2005-3534 reintroduced in upstream nbd-v2.9.0 version', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611187', 'name': 'http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611187', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://github.com/yoe/nbd/commit/3ef52043861ab16352d49af89e048ba6339d6df8', 'name': 'https://github.com/yoe/nbd/commit/3ef52043861ab16352d49af89e048ba6339d6df8', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/43353', 'name': '43353', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=673562', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=673562', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://lists.fedoraproject.org/pipermail/package-announce/2011-February/054071.html', 'name': 'FEDORA-2011-1097', 'refsource': 'FEDORA', 'tags': ['Patch']}, {'url': 'http://www.vupen.com/english/advisories/2011/0403', 'name': 'ADV-2011-0403', 'refsource': 'VUPEN', 'tags': ['Vendor Advisory']}, {'url': 'http://openwall.com/lists/oss-security/2011/01/28/3', 'name': '[oss-security] 20110128 CVE Request -- NDB: CVE-2005-3534 reintroduced in upstream nbd-v2.9.0 version', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/46572', 'name': '46572', 'refsource': 'BID', 'tags': []}, {'url': 'http://www.vupen.com/english/advisories/2011/0582', 'name': 'ADV-2011-0582', 'refsource': 'VUPEN', 'tags': []}, {'url': 'http://www.debian.org/security/2011/dsa-2183', 'name': 'DSA-2183', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'http://secunia.com/advisories/43610', 'name': '43610', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'https://hermes.opensuse.org/messages/8086846', 'name': 'openSUSE-SU-2011:0193', 'refsource': 'SUSE', 'tags': []}, {'url': 'http://security.gentoo.org/glsa/glsa-201206-35.xml', 'name': 'GLSA-201206-35', 'refsource': 'GENTOO', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00000.html', 'name': 'SUSE-SR:2011:005', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://exchange.xforce.ibmcloud.com/vulnerabilities/65720', 'name': 'networkblock-nbdserver-bo(65720)', 'refsource': 'XF', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.13:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.15:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.18:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:*:*:*:*:*:*:*:*', 'versionEndIncluding': '2.9.19', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.16:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.17:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:wouter_verhelst:nbd:2.9.9:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Buffer overflow in the mainloop function in nbd-server.c in the server in Network Block Device (nbd) before 2.9.20 might allow remote attackers to execute arbitrary code via a long request. NOTE: this issue exists because of a CVE-2005-3534 regression.'}]
2017-08-17T01:33Z
2011-02-22T19:00Z
Improper Restriction of Operations within the Bounds of a Memory Buffer
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. 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.
https://cwe.mitre.org/data/definitions/119.html
0
Wouter Verhelst
2011-01-27 22:30:09+01:00
Fix buffer size checking Yes, this means we've re-introduced CVE-2005-3534. Sigh.
3ef52043861ab16352d49af89e048ba6339d6df8
False
visit repo url
visit repo url
visit repo url
visit repo url
visit repo url
yoe
visit repo url
visit repo url
mainloop
mainloop( CLIENT * client)
['client']
int mainloop(CLIENT *client) { struct nbd_request request; struct nbd_reply reply; gboolean go_on=TRUE; #ifdef DODBG int i = 0; #endif negotiate(client->net, client, NULL); DEBUG("Entering request loop!\n"); reply.magic = htonl(NBD_REPLY_MAGIC); reply.error = 0; while (go_on) { char buf[BUFSIZE]; size_t len; #ifdef DODBG i++; printf("%d: ", i); #endif readit(client->net, &request, sizeof(request)); request.from = ntohll(request.from); request.type = ntohl(request.type); if (request.type==NBD_CMD_DISC) { msg2(LOG_INFO, "Disconnect request received."); if (client->server->flags & F_COPYONWRITE) { if (client->difmap) g_free(client->difmap) ; close(client->difffile); unlink(client->difffilename); free(client->difffilename); } go_on=FALSE; continue; } len = ntohl(request.len); if (request.magic != htonl(NBD_REQUEST_MAGIC)) err("Not enough magic."); if (len > BUFSIZE + sizeof(struct nbd_reply)) err("Request too big!"); #ifdef DODBG printf("%s from %llu (%llu) len %d, ", request.type ? "WRITE" : "READ", (unsigned long long)request.from, (unsigned long long)request.from / 512, len); #endif memcpy(reply.handle, request.handle, sizeof(reply.handle)); if ((request.from + len) > (OFFT_MAX)) { DEBUG("[Number too large!]"); ERROR(client, reply, EINVAL); continue; } if (((ssize_t)((off_t)request.from + len) > client->exportsize)) { DEBUG("[RANGE!]"); ERROR(client, reply, EINVAL); continue; } if (request.type==NBD_CMD_WRITE) { DEBUG("wr: net->buf, "); readit(client->net, buf, len); DEBUG("buf->exp, "); if ((client->server->flags & F_READONLY) || (client->server->flags & F_AUTOREADONLY)) { DEBUG("[WRITE to READONLY!]"); ERROR(client, reply, EPERM); continue; } if (expwrite(request.from, buf, len, client)) { DEBUG("Write failed: %m" ); ERROR(client, reply, errno); continue; } SEND(client->net, reply); DEBUG("OK!\n"); continue; } /* READ */ DEBUG("exp->buf, "); if (expread(request.from, buf + sizeof(struct nbd_reply), len, client)) { DEBUG("Read failed: %m"); ERROR(client, reply, errno); continue; } DEBUG("buf->net, "); memcpy(buf, &reply, sizeof(struct nbd_reply)); writeit(client->net, buf, len + sizeof(struct nbd_reply)); DEBUG("OK!\n"); } return 0; }
563
True
1
CVE-2011-1488
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:P
LOCAL
MEDIUM
NONE
NONE
NONE
PARTIAL
1.9
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1488', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1488', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2011-1488', 'name': 'https://access.redhat.com/security/cve/cve-2011-1488', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security-tracker.debian.org/tracker/CVE-2011-1488', 'name': 'https://security-tracker.debian.org/tracker/CVE-2011-1488', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'name': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'name': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-772'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rsyslog:rsyslog:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.7.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:11.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A memory leak in rsyslog before 5.7.6 was found in the way deamon processed log messages are logged when $RepeatedMsgReduction was enabled. A local attacker could use this flaw to cause a denial of the rsyslogd daemon service by crashing the service via a sequence of repeated log messages sent within short periods of time.'}]
2020-08-18T15:05Z
2019-11-14T02:15Z
Missing Release of Resource after Effective Lifetime
The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
When a resource is not released after use, it can allow attackers to cause a denial of service by causing the allocation of resources without triggering their release. Frequently-affected resources include memory, CPU, disk space, power or battery, etc.
https://cwe.mitre.org/data/definitions/772.html
0
Rainer Gerhards
2011-02-25 14:14:17+01:00
bugfix: fixed a memory leak and potential abort condition this could happen if multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226 fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218
1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a
False
rsyslog/rsyslog
a Rocket-fast SYStem for LOG processing
2013-06-03 15:57:55
2022-08-26 14:28:13
http://www.rsyslog.com
rsyslog
1629.0
594.0
batchCopyElem
batchCopyElem( batch_obj_t * pDest , batch_obj_t * pSrc)
['pDest', 'pSrc']
batchCopyElem(batch_obj_t *pDest, batch_obj_t *pSrc) { memcpy(pDest, pSrc, sizeof(batch_obj_t)); }
24
True
1
CVE-2011-1489
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://security-tracker.debian.org/tracker/CVE-2011-1489', 'name': 'https://security-tracker.debian.org/tracker/CVE-2011-1489', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'name': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1489', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1489', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2011-1489', 'name': 'https://access.redhat.com/security/cve/cve-2011-1489', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'name': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-772'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rsyslog:rsyslog:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.7.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:11.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A memory leak in rsyslog before 5.7.6 was found in the way deamon processed log messages were logged when multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. A local attacker could cause denial of the rsyslogd daemon service via a log message belonging to more than one ruleset.'}]
2020-08-18T15:05Z
2019-11-14T02:15Z
Missing Release of Resource after Effective Lifetime
The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
When a resource is not released after use, it can allow attackers to cause a denial of service by causing the allocation of resources without triggering their release. Frequently-affected resources include memory, CPU, disk space, power or battery, etc.
https://cwe.mitre.org/data/definitions/772.html
0
Rainer Gerhards
2011-02-25 14:14:17+01:00
bugfix: fixed a memory leak and potential abort condition this could happen if multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226 fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218
1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a
False
rsyslog/rsyslog
a Rocket-fast SYStem for LOG processing
2013-06-03 15:57:55
2022-08-26 14:28:13
http://www.rsyslog.com
rsyslog
1629.0
594.0
batchCopyElem
batchCopyElem( batch_obj_t * pDest , batch_obj_t * pSrc)
['pDest', 'pSrc']
batchCopyElem(batch_obj_t *pDest, batch_obj_t *pSrc) { memcpy(pDest, pSrc, sizeof(batch_obj_t)); }
24
True
1
CVE-2011-1490
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://security-tracker.debian.org/tracker/CVE-2011-1490', 'name': 'https://security-tracker.debian.org/tracker/CVE-2011-1490', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2011-1490', 'name': 'https://access.redhat.com/security/cve/cve-2011-1490', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1490', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1490', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'name': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'name': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-772'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rsyslog:rsyslog:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.7.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:11.4:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A memory leak in rsyslog before 5.7.6 was found in the way deamon processed log messages are logged when multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. A local attacker could cause denial of the rsyslogd daemon service via a log message belonging to more than one ruleset'}]
2020-08-18T15:05Z
2019-11-14T02:15Z
Missing Release of Resource after Effective Lifetime
The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
When a resource is not released after use, it can allow attackers to cause a denial of service by causing the allocation of resources without triggering their release. Frequently-affected resources include memory, CPU, disk space, power or battery, etc.
https://cwe.mitre.org/data/definitions/772.html
0
Rainer Gerhards
2011-02-25 14:14:17+01:00
bugfix: fixed a memory leak and potential abort condition this could happen if multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226 fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218
1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a
False
rsyslog/rsyslog
a Rocket-fast SYStem for LOG processing
2013-06-03 15:57:55
2022-08-26 14:28:13
http://www.rsyslog.com
rsyslog
1629.0
594.0
batchCopyElem
batchCopyElem( batch_obj_t * pDest , batch_obj_t * pSrc)
['pDest', 'pSrc']
batchCopyElem(batch_obj_t *pDest, batch_obj_t *pSrc) { memcpy(pDest, pSrc, sizeof(batch_obj_t)); }
24
True
1
CVE-2011-1488
False
False
False
False
AV:L/AC:M/Au:N/C:N/I:N/A:P
LOCAL
MEDIUM
NONE
NONE
NONE
PARTIAL
1.9
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1488', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1488', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2011-1488', 'name': 'https://access.redhat.com/security/cve/cve-2011-1488', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://security-tracker.debian.org/tracker/CVE-2011-1488', 'name': 'https://security-tracker.debian.org/tracker/CVE-2011-1488', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'name': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'name': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-772'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rsyslog:rsyslog:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.7.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:11.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A memory leak in rsyslog before 5.7.6 was found in the way deamon processed log messages are logged when $RepeatedMsgReduction was enabled. A local attacker could use this flaw to cause a denial of the rsyslogd daemon service by crashing the service via a sequence of repeated log messages sent within short periods of time.'}]
2020-08-18T15:05Z
2019-11-14T02:15Z
Missing Release of Resource after Effective Lifetime
The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
When a resource is not released after use, it can allow attackers to cause a denial of service by causing the allocation of resources without triggering their release. Frequently-affected resources include memory, CPU, disk space, power or battery, etc.
https://cwe.mitre.org/data/definitions/772.html
0
Rainer Gerhards
2011-02-25 14:14:17+01:00
bugfix: fixed a memory leak and potential abort condition this could happen if multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226 fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218
1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a
False
rsyslog/rsyslog
a Rocket-fast SYStem for LOG processing
2013-06-03 15:57:55
2022-08-26 14:28:13
http://www.rsyslog.com
rsyslog
1629.0
594.0
processBatchMultiRuleset
processBatchMultiRuleset( batch_t * pBatch)
['pBatch']
processBatchMultiRuleset(batch_t *pBatch) { ruleset_t *currRuleset; batch_t snglRuleBatch; int i; int iStart; /* start index of partial batch */ int iNew; /* index for new (temporary) batch */ DEFiRet; CHKiRet(batchInit(&snglRuleBatch, pBatch->nElem)); snglRuleBatch.pbShutdownImmediate = pBatch->pbShutdownImmediate; while(1) { /* loop broken inside */ /* search for first unprocessed element */ for(iStart = 0 ; iStart < pBatch->nElem && pBatch->pElem[iStart].state == BATCH_STATE_DISC ; ++iStart) /* just search, no action */; if(iStart == pBatch->nElem) FINALIZE; /* everything processed */ /* prepare temporary batch */ currRuleset = batchElemGetRuleset(pBatch, iStart); iNew = 0; for(i = iStart ; i < pBatch->nElem ; ++i) { if(batchElemGetRuleset(pBatch, i) == currRuleset) { batchCopyElem(&(snglRuleBatch.pElem[iNew++]), &(pBatch->pElem[i])); /* We indicate the element also as done, so it will not be processed again */ pBatch->pElem[i].state = BATCH_STATE_DISC; } } snglRuleBatch.nElem = iNew; /* was left just right by the for loop */ batchSetSingleRuleset(&snglRuleBatch, 1); /* process temp batch */ processBatch(&snglRuleBatch); } batchFree(&snglRuleBatch); finalize_it: RETiRet; }
198
True
1
CVE-2011-1489
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://security-tracker.debian.org/tracker/CVE-2011-1489', 'name': 'https://security-tracker.debian.org/tracker/CVE-2011-1489', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'name': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1489', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1489', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2011-1489', 'name': 'https://access.redhat.com/security/cve/cve-2011-1489', 'refsource': 'MISC', 'tags': ['Exploit', 'Patch', 'Third Party Advisory']}, {'url': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'name': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-772'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rsyslog:rsyslog:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.7.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:11.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A memory leak in rsyslog before 5.7.6 was found in the way deamon processed log messages were logged when multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. A local attacker could cause denial of the rsyslogd daemon service via a log message belonging to more than one ruleset.'}]
2020-08-18T15:05Z
2019-11-14T02:15Z
Missing Release of Resource after Effective Lifetime
The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
When a resource is not released after use, it can allow attackers to cause a denial of service by causing the allocation of resources without triggering their release. Frequently-affected resources include memory, CPU, disk space, power or battery, etc.
https://cwe.mitre.org/data/definitions/772.html
0
Rainer Gerhards
2011-02-25 14:14:17+01:00
bugfix: fixed a memory leak and potential abort condition this could happen if multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226 fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218
1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a
False
rsyslog/rsyslog
a Rocket-fast SYStem for LOG processing
2013-06-03 15:57:55
2022-08-26 14:28:13
http://www.rsyslog.com
rsyslog
1629.0
594.0
processBatchMultiRuleset
processBatchMultiRuleset( batch_t * pBatch)
['pBatch']
processBatchMultiRuleset(batch_t *pBatch) { ruleset_t *currRuleset; batch_t snglRuleBatch; int i; int iStart; /* start index of partial batch */ int iNew; /* index for new (temporary) batch */ DEFiRet; CHKiRet(batchInit(&snglRuleBatch, pBatch->nElem)); snglRuleBatch.pbShutdownImmediate = pBatch->pbShutdownImmediate; while(1) { /* loop broken inside */ /* search for first unprocessed element */ for(iStart = 0 ; iStart < pBatch->nElem && pBatch->pElem[iStart].state == BATCH_STATE_DISC ; ++iStart) /* just search, no action */; if(iStart == pBatch->nElem) FINALIZE; /* everything processed */ /* prepare temporary batch */ currRuleset = batchElemGetRuleset(pBatch, iStart); iNew = 0; for(i = iStart ; i < pBatch->nElem ; ++i) { if(batchElemGetRuleset(pBatch, i) == currRuleset) { batchCopyElem(&(snglRuleBatch.pElem[iNew++]), &(pBatch->pElem[i])); /* We indicate the element also as done, so it will not be processed again */ pBatch->pElem[i].state = BATCH_STATE_DISC; } } snglRuleBatch.nElem = iNew; /* was left just right by the for loop */ batchSetSingleRuleset(&snglRuleBatch, 1); /* process temp batch */ processBatch(&snglRuleBatch); } batchFree(&snglRuleBatch); finalize_it: RETiRet; }
198
True
1
CVE-2011-1490
False
False
False
False
AV:L/AC:L/Au:N/C:N/I:N/A:P
LOCAL
LOW
NONE
NONE
NONE
PARTIAL
2.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
LOCAL
LOW
LOW
NONE
UNCHANGED
NONE
NONE
HIGH
5.5
MEDIUM
1.8
3.6
False
[{'url': 'https://security-tracker.debian.org/tracker/CVE-2011-1490', 'name': 'https://security-tracker.debian.org/tracker/CVE-2011-1490', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2011-1490', 'name': 'https://access.redhat.com/security/cve/cve-2011-1490', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1490', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1490', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'name': 'http://lists.opensuse.org/opensuse-security-announce/2011-04/msg00005.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'name': 'https://github.com/rsyslog/rsyslog/commit/1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-772'}]}]
LOW
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:rsyslog:rsyslog:*:*:*:*:*:*:*:*', 'versionEndExcluding': '5.7.6', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:11.4:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'A memory leak in rsyslog before 5.7.6 was found in the way deamon processed log messages are logged when multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. A local attacker could cause denial of the rsyslogd daemon service via a log message belonging to more than one ruleset'}]
2020-08-18T15:05Z
2019-11-14T02:15Z
Missing Release of Resource after Effective Lifetime
The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.
When a resource is not released after use, it can allow attackers to cause a denial of service by causing the allocation of resources without triggering their release. Frequently-affected resources include memory, CPU, disk space, power or battery, etc.
https://cwe.mitre.org/data/definitions/772.html
0
Rainer Gerhards
2011-02-25 14:14:17+01:00
bugfix: fixed a memory leak and potential abort condition this could happen if multiple rulesets were used and some output batches contained messages belonging to more than one ruleset. fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=226 fixes: http://bugzilla.adiscon.com/show_bug.cgi?id=218
1ef709cc97d54f74d3fdeb83788cc4b01f4c6a2a
False
rsyslog/rsyslog
a Rocket-fast SYStem for LOG processing
2013-06-03 15:57:55
2022-08-26 14:28:13
http://www.rsyslog.com
rsyslog
1629.0
594.0
processBatchMultiRuleset
processBatchMultiRuleset( batch_t * pBatch)
['pBatch']
processBatchMultiRuleset(batch_t *pBatch) { ruleset_t *currRuleset; batch_t snglRuleBatch; int i; int iStart; /* start index of partial batch */ int iNew; /* index for new (temporary) batch */ DEFiRet; CHKiRet(batchInit(&snglRuleBatch, pBatch->nElem)); snglRuleBatch.pbShutdownImmediate = pBatch->pbShutdownImmediate; while(1) { /* loop broken inside */ /* search for first unprocessed element */ for(iStart = 0 ; iStart < pBatch->nElem && pBatch->pElem[iStart].state == BATCH_STATE_DISC ; ++iStart) /* just search, no action */; if(iStart == pBatch->nElem) FINALIZE; /* everything processed */ /* prepare temporary batch */ currRuleset = batchElemGetRuleset(pBatch, iStart); iNew = 0; for(i = iStart ; i < pBatch->nElem ; ++i) { if(batchElemGetRuleset(pBatch, i) == currRuleset) { batchCopyElem(&(snglRuleBatch.pElem[iNew++]), &(pBatch->pElem[i])); /* We indicate the element also as done, so it will not be processed again */ pBatch->pElem[i].state = BATCH_STATE_DISC; } } snglRuleBatch.nElem = iNew; /* was left just right by the for loop */ batchSetSingleRuleset(&snglRuleBatch, 1); /* process temp batch */ processBatch(&snglRuleBatch); } batchFree(&snglRuleBatch); finalize_it: RETiRet; }
198
True
1
CVE-2019-20176
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/jedisct1/pure-ftpd/commit/aea56f4bcb9948d456f3fae4d044fd3fa2e19706', 'name': 'https://github.com/jedisct1/pure-ftpd/commit/aea56f4bcb9948d456f3fae4d044fd3fa2e19706', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/AHZG5FPCRMCB6Z3L7FPICC6BZ5ZATFTO/', 'name': 'FEDORA-2020-85fa9f07f4', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/PICL3U2J4EPGBLOE555Y5RAZTQL3WBBV/', 'name': 'FEDORA-2020-74b71e5873', 'refsource': 'FEDORA', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-400'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.49:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In Pure-FTPd 1.0.49, a stack exhaustion issue was discovered in the listdir function in ls.c.'}]
2020-02-08T04:15Z
2019-12-31T15:15Z
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
Limited resources include memory, file system storage, database connection pool entries, and 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. There are at least three distinct scenarios which can commonly lead to resource exhaustion: Lack of throttling for the number of allocated resources Losing all references to a resource before reaching the shutdown stage Not closing/returning a resource after processing Resource exhaustion problems are often result due to an incorrect implementation of the following situations: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for releasing the resource.
https://cwe.mitre.org/data/definitions/400.html
0
Frank Denis
2019-12-30 17:40:04+01:00
listdir(): reuse a single buffer to store every file name to display Allocating a new buffer for each entry is useless. And as these buffers are allocated on the stack, on systems with a small stack size, with many entries, the limit can easily be reached, causing a stack exhaustion and aborting the user session. Reported by Antonio Morales from the GitHub Security Lab team, thanks!
aea56f4bcb9948d456f3fae4d044fd3fa2e19706
False
jedisct1/pure-ftpd
Pure FTP server
2009-09-09 10:23:17
2022-07-20 11:08:02
https://www.pureftpd.org
jedisct1
510.0
165.0
listdir
listdir( unsigned int depth , int f , void * const tls_fd , const char * name)
['depth', 'f', 'tls_fd', 'name']
static void listdir(unsigned int depth, int f, void * const tls_fd, const char *name) { PureFileInfo *dir; char *names; PureFileInfo *s; PureFileInfo *r; int d; if (depth >= max_ls_depth || matches >= max_ls_files) { return; } if ((dir = sreaddir(&names)) == NULL) { addreply(226, MSG_CANT_READ_FILE, name); return; } s = dir; while (s->name_offset != (size_t) -1) { d = 0; if (FI_NAME(s)[0] != '.') { d = listfile(s, NULL); } else if (opt_a) { if (FI_NAME(s)[1] == 0 || (FI_NAME(s)[1] == '.' && FI_NAME(s)[2] == 0)) { listfile(s, NULL); } else { d = listfile(s, NULL); } } if (!d) { s->name_offset = (size_t) -1; } s++; } outputfiles(f, tls_fd); r = dir; while (opt_R && r != s) { if (r->name_offset != (size_t) -1 && !chdir(FI_NAME(r))) { char *alloca_subdir; const size_t sizeof_subdir = PATH_MAX + 1U; if ((alloca_subdir = ALLOCA(sizeof_subdir)) == NULL) { goto toomany; } if (SNCHECK(snprintf(alloca_subdir, sizeof_subdir, "%s/%s", name, FI_NAME(r)), sizeof_subdir)) { goto nolist; } wrstr(f, tls_fd, "\r\n\r\n"); wrstr(f, tls_fd, alloca_subdir); wrstr(f, tls_fd, ":\r\n\r\n"); listdir(depth + 1U, f, tls_fd, alloca_subdir); nolist: ALLOCA_FREE(alloca_subdir); if (matches >= max_ls_files) { goto toomany; } if (chdir("..")) { /* defensive in the extreme... */ if (chdir(wd) || chdir(name)) { /* someone rmdir()'d it? */ die(421, LOG_ERR, "chdir: %s", strerror(errno)); } } } r++; } toomany: free(names); free(dir); names = NULL; }
424
True
1
CVE-2020-9274
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:N
NETWORK
LOW
NONE
PARTIAL
NONE
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/jedisct1/pure-ftpd/commit/8d0d42542e2cb7a56d645fbe4d0ef436e38bcefa', 'name': 'https://github.com/jedisct1/pure-ftpd/commit/8d0d42542e2cb7a56d645fbe4d0ef436e38bcefa', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.pureftpd.org/project/pure-ftpd/news/', 'name': 'https://www.pureftpd.org/project/pure-ftpd/news/', 'refsource': 'MISC', 'tags': ['Vendor Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/02/msg00029.html', 'name': '[debian-lts-announce] 20200228 [SECURITY] [DLA 2123-1] pure-ftpd security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202003-54', 'name': 'GLSA-202003-54', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/22P44PECZWNDP7CMBL7NRBMNFS73C5Z2/', 'name': 'FEDORA-2020-5ac8d4c11a', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/U5DBVHJCXWRSJPNJQCJQCKZF6ZDPZCKA/', 'name': 'FEDORA-2020-84fb0920fd', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/B5NSUDWXZVWUCL6R2PTX3KBB42Z62CA5/', 'name': 'FEDORA-2020-fa83ea0492', 'refsource': 'FEDORA', 'tags': []}, {'url': 'https://usn.ubuntu.com/4515-1/', 'name': 'USN-4515-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-824'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.49:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in Pure-FTPd 1.0.49. An uninitialized pointer vulnerability has been detected in the diraliases linked list. When the *lookup_alias(const char alias) or print_aliases(void) function is called, they fail to correctly detect the end of the linked list and try to access a non-existent list member. This is related to init_aliases in diraliases.c.'}]
2020-09-22T06:15Z
2020-02-26T16:15Z
Access of Uninitialized Pointer
The program accesses or uses a pointer that has not been initialized.
If the pointer contains an uninitialized value, then the value might not point to a valid memory location. This could cause the program to read from or write to unexpected memory locations, leading to a denial of service. If the uninitialized pointer is used as a function call, then arbitrary functions could be invoked. If an attacker can influence the portion of uninitialized memory that is contained in the pointer, this weakness could be leveraged to execute code or perform other attacks. 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.
https://cwe.mitre.org/data/definitions/824.html
0
Frank Denis
2020-02-18 18:36:58+01:00
diraliases: always set the tail of the list to NULL Spotted and reported by Antonio Norales from GitHub Security Labs. Thanks!
8d0d42542e2cb7a56d645fbe4d0ef436e38bcefa
False
jedisct1/pure-ftpd
Pure FTP server
2009-09-09 10:23:17
2022-07-20 11:08:02
https://www.pureftpd.org
jedisct1
510.0
165.0
init_aliases
init_aliases( void)
['void']
int init_aliases(void) { FILE *fp; char alias[MAXALIASLEN + 1U]; char dir[PATH_MAX + 1U]; if ((fp = fopen(ALIASES_FILE, "r")) == NULL) { return 0; } while (fgets(alias, sizeof alias, fp) != NULL) { if (*alias == '#' || *alias == '\n' || *alias == 0) { continue; } { char * const z = alias + strlen(alias) - 1U; if (*z != '\n') { goto bad; } *z = 0; } do { if (fgets(dir, sizeof dir, fp) == NULL || *dir == 0) { goto bad; } { char * const z = dir + strlen(dir) - 1U; if (*z == '\n') { *z = 0; } } } while (*dir == '#' || *dir == 0); if (head == NULL) { if ((head = tail = malloc(sizeof *head)) == NULL || (tail->alias = strdup(alias)) == NULL || (tail->dir = strdup(dir)) == NULL) { die_mem(); } tail->next = NULL; } else { DirAlias *curr; if ((curr = malloc(sizeof *curr)) == NULL || (curr->alias = strdup(alias)) == NULL || (curr->dir = strdup(dir)) == NULL) { die_mem(); } tail->next = curr; tail = curr; } } fclose(fp); aliases_up++; return 0; bad: fclose(fp); logfile(LOG_ERR, MSG_ALIASES_BROKEN_FILE " [" ALIASES_FILE "]"); return -1; }
345
True
1
CVE-2020-9365
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:N/A:N
NETWORK
LOW
NONE
PARTIAL
NONE
NONE
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
NONE
NONE
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/jedisct1/pure-ftpd/commit/36c6d268cb190282a2c17106acfd31863121b58e', 'name': 'https://github.com/jedisct1/pure-ftpd/commit/36c6d268cb190282a2c17106acfd31863121b58e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202003-54', 'name': 'GLSA-202003-54', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/22P44PECZWNDP7CMBL7NRBMNFS73C5Z2/', 'name': 'FEDORA-2020-5ac8d4c11a', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/U5DBVHJCXWRSJPNJQCJQCKZF6ZDPZCKA/', 'name': 'FEDORA-2020-84fb0920fd', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/B5NSUDWXZVWUCL6R2PTX3KBB42Z62CA5/', 'name': 'FEDORA-2020-fa83ea0492', 'refsource': 'FEDORA', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/jedisct1/pure-ftpd/commit/bf6fcd4935e95128cf22af5924cdc8fe5c0579da', 'name': 'https://github.com/jedisct1/pure-ftpd/commit/bf6fcd4935e95128cf22af5924cdc8fe5c0579da', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.49:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:30:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:31:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An issue was discovered in Pure-FTPd 1.0.49. An out-of-bounds (OOB) read has been detected in the pure_strcmp function in utils.c.'}]
2020-11-16T19:32Z
2020-02-24T16:15Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Frank Denis
2020-02-24 15:19:43+01:00
pure_strcmp(): len(s2) can be > len(s1) Reported by Antonio Morales from GitHub Security Labs, thanks!
bf6fcd4935e95128cf22af5924cdc8fe5c0579da
False
jedisct1/pure-ftpd
Pure FTP server
2009-09-09 10:23:17
2022-07-20 11:08:02
https://www.pureftpd.org
jedisct1
510.0
165.0
pure_strcmp
pure_strcmp( const char * const s1 , const char * const s2)
['s1', 's2']
int pure_strcmp(const char * const s1, const char * const s2) { return pure_memcmp(s1, s2, strlen(s1) + 1U); }
31
True
1
CVE-2021-40524
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/jedisct1/pure-ftpd/pull/158', 'name': 'https://github.com/jedisct1/pure-ftpd/pull/158', 'refsource': 'MISC', 'tags': ['Exploit', 'Third Party Advisory']}, {'url': 'https://github.com/jedisct1/pure-ftpd/commit/37ad222868e52271905b94afea4fc780d83294b4', 'name': 'https://github.com/jedisct1/pure-ftpd/commit/37ad222868e52271905b94afea4fc780d83294b4', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/jedisct1/pure-ftpd/compare/1.0.49...1.0.50', 'name': 'https://github.com/jedisct1/pure-ftpd/compare/1.0.49...1.0.50', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-434'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:*:*:*:*:*:*:*:*', 'versionStartIncluding': '1.0.23', 'versionEndExcluding': '1.0.50', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In Pure-FTPd before 1.0.50, an incorrect max_filesize quota mechanism in the server allows attackers to upload files of unbounded size, which may lead to denial of service or a server hang. This occurs because a certain greater-than-zero test does not anticipate an initial -1 value. (Versions 1.0.23 through 1.0.49 are affected.)'}]
2021-11-26T19:49Z
2021-09-05T19:15Z
Unrestricted Upload of File with Dangerous Type
The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.
https://cwe.mitre.org/data/definitions/434.html
0
Frank Denis
2021-11-23 18:53:34+01:00
Initialize the max upload file size when quotas are enabled Due to an unwanted check, files causing the quota to be exceeded were deleted after the upload, but not during the upload. The bug was introduced in 2009 in version 1.0.23 Spotted by @DroidTest, thanks!
37ad222868e52271905b94afea4fc780d83294b4
False
jedisct1/pure-ftpd
Pure FTP server
2009-09-09 10:23:17
2022-07-20 11:08:02
https://www.pureftpd.org
jedisct1
510.0
165.0
dostor
dostor( char * name , const int append , const int autorename)
['name', 'append', 'autorename']
void dostor(char *name, const int append, const int autorename) { ULHandler ulhandler; int f; const char *ul_name = NULL; const char *atomic_file = NULL; off_t filesize = (off_t) 0U; struct stat st; double started = 0.0; signed char overwrite = 0; int overflow = 0; int ret = -1; off_t max_filesize = (off_t) -1; #ifdef QUOTAS Quota quota; #endif const char *name2 = NULL; if (type < 1 || (type == 1 && restartat > (off_t) 1)) { addreply_noformat(503, MSG_NO_ASCII_RESUME); goto end; } #ifndef ANON_CAN_RESUME if (guest != 0 && anon_noupload != 0) { addreply_noformat(550, MSG_ANON_CANT_OVERWRITE); goto end; } #endif if (ul_check_free_space(name, -1.0) == 0) { addreply_noformat(552, MSG_NO_DISK_SPACE); goto end; } if (checknamesanity(name, dot_write_ok) != 0) { addreply(553, MSG_SANITY_FILE_FAILURE, name); goto end; } if (autorename != 0) { no_truncate = 1; } if (restartat > (off_t) 0 || no_truncate != 0) { if ((atomic_file = get_atomic_file(name)) == NULL) { addreply(553, MSG_SANITY_FILE_FAILURE, name); goto end; } if (restartat > (off_t) 0 && rename(name, atomic_file) != 0 && errno != ENOENT) { error(553, MSG_RENAME_FAILURE); atomic_file = NULL; goto end; } } if (atomic_file != NULL) { ul_name = atomic_file; } else { ul_name = name; } if (atomic_file == NULL && (f = open(ul_name, O_WRONLY | O_NOFOLLOW)) != -1) { overwrite++; } else if ((f = open(ul_name, O_CREAT | O_WRONLY | O_NOFOLLOW, (mode_t) 0777 & ~u_mask)) == -1) { error(553, MSG_OPEN_FAILURE2); goto end; } if (fstat(f, &st) < 0) { (void) close(f); error(553, MSG_STAT_FAILURE2); goto end; } if (!S_ISREG(st.st_mode)) { (void) close(f); addreply_noformat(550, MSG_NOT_REGULAR_FILE); goto end; } alarm(MAX_SESSION_XFER_IDLE); /* Anonymous users *CAN* overwrite 0-bytes files - This is the right behavior */ if (st.st_size > (off_t) 0) { #ifndef ANON_CAN_RESUME if (guest != 0) { addreply_noformat(550, MSG_ANON_CANT_OVERWRITE); (void) close(f); goto end; } #endif if (append != 0) { restartat = st.st_size; } } else { restartat = (off_t) 0; } if (restartat > st.st_size) { restartat = st.st_size; } if (restartat > (off_t) 0 && lseek(f, restartat, SEEK_SET) < (off_t) 0) { (void) close(f); error(451, "seek"); goto end; } if (restartat < st.st_size) { if (ftruncate(f, restartat) < 0) { (void) close(f); error(451, "ftruncate"); goto end; } #ifdef QUOTAS if (restartat != st.st_size) { (void) quota_update(NULL, 0LL, (long long) (restartat - st.st_size), &overflow); } #endif } #ifdef QUOTAS if (quota_update(&quota, 0LL, 0LL, &overflow) == 0 && (overflow > 0 || quota.files >= user_quota_files || quota.size > user_quota_size || (max_filesize >= (off_t) 0 && (max_filesize = user_quota_size - quota.size) < (off_t) 0))) { overflow = 1; (void) close(f); goto afterquota; } #endif opendata(); if (xferfd == -1) { (void) close(f); goto end; } doreply(); # ifdef WITH_TLS if (data_protection_level == CPL_PRIVATE) { tls_init_data_session(xferfd, passive); } # endif state_needs_update = 1; setprocessname("pure-ftpd (UPLOAD)"); filesize = restartat; #ifdef FTPWHO if (shm_data_cur != NULL) { const size_t sl = strlen(name); ftpwho_lock(); shm_data_cur->state = FTPWHO_STATE_UPLOAD; shm_data_cur->download_total_size = (off_t) 0U; shm_data_cur->download_current_size = (off_t) filesize; shm_data_cur->restartat = restartat; (void) time(&shm_data_cur->xfer_date); if (sl < sizeof shm_data_cur->filename) { memcpy(shm_data_cur->filename, name, sl); shm_data_cur->filename[sl] = 0; } else { memcpy(shm_data_cur->filename, &name[sl - sizeof shm_data_cur->filename - 1U], sizeof shm_data_cur->filename); } ftpwho_unlock(); } #endif /* Here starts the real upload code */ started = get_usec_time(); if (ul_init(&ulhandler, clientfd, tls_cnx, xferfd, name, f, tls_data_cnx, restartat, type == 1, throttling_bandwidth_ul, max_filesize) == 0) { ret = ul_send(&ulhandler); ul_exit(&ulhandler); } else { ret = -1; } (void) close(f); closedata(); /* Here ends the real upload code */ #ifdef SHOW_REAL_DISK_SPACE if (FSTATFS(f, &statfsbuf) == 0) { double space; space = (double) STATFS_BAVAIL(statfsbuf) * (double) STATFS_FRSIZE(statfsbuf); if (space > 524288.0) { addreply(0, MSG_SPACE_FREE_M, space / 1048576.0); } else { addreply(0, MSG_SPACE_FREE_K, space / 1024.0); } } #endif uploaded += (unsigned long long) ulhandler.total_uploaded; { off_t atomic_file_size; off_t original_file_size; int files_count; if (overwrite == 0) { files_count = 1; } else { files_count = 0; } if (autorename != 0 && restartat == (off_t) 0) { if ((atomic_file_size = get_file_size(atomic_file)) < (off_t) 0) { goto afterquota; } if (tryautorename(atomic_file, name, &name2) != 0) { error(553, MSG_RENAME_FAILURE); goto afterquota; } else { #ifdef QUOTAS ul_quota_update(name2 ? name2 : name, 1, atomic_file_size); #endif atomic_file = NULL; } } else if (atomic_file != NULL) { if ((atomic_file_size = get_file_size(atomic_file)) < (off_t) 0) { goto afterquota; } if ((original_file_size = get_file_size(name)) < (off_t) 0 || restartat > original_file_size) { original_file_size = restartat; } if (rename(atomic_file, name) != 0) { error(553, MSG_RENAME_FAILURE); goto afterquota; } else { #ifdef QUOTAS overflow = ul_quota_update (name, files_count, atomic_file_size - original_file_size); #endif atomic_file = NULL; } } else { #ifdef QUOTAS overflow = ul_quota_update (name, files_count, ulhandler.total_uploaded); #endif } } afterquota: if (overflow > 0) { addreply(552, MSG_QUOTA_EXCEEDED, name); } else { if (ret == 0) { addreply_noformat(226, MSG_TRANSFER_SUCCESSFUL); } else { addreply_noformat(451, MSG_ABORTED); } displayrate(MSG_UPLOADED, ulhandler.total_uploaded, started, name2 ? name2 : name, 1); } end: restartat = (off_t) 0; if (atomic_file != NULL) { unlink(atomic_file); atomic_file = NULL; } }
1373
True
1
CVE-2011-1575
False
False
False
False
AV:N/AC:M/Au:N/C:P/I:P/A:N
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
NONE
5.8
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
[{'url': 'http://openwall.com/lists/oss-security/2011/04/11/8', 'name': '[oss-security] 20110411 Re: pure-ftpd STARTTLS command injection / new CVE?', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://openwall.com/lists/oss-security/2011/04/11/7', 'name': '[oss-security] 20110411 Re: pure-ftpd STARTTLS command injection / new CVE?', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://openwall.com/lists/oss-security/2011/04/11/14', 'name': '[oss-security] 20110411 Re: pure-ftpd STARTTLS command injection / new CVE?', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://secunia.com/advisories/43988', 'name': '43988', 'refsource': 'SECUNIA', 'tags': ['Vendor Advisory']}, {'url': 'https://github.com/jedisct1/pure-ftpd/commit/65c4d4ad331e94661de763e9b5304d28698999c4', 'name': 'https://github.com/jedisct1/pure-ftpd/commit/65c4d4ad331e94661de763e9b5304d28698999c4', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'http://secunia.com/advisories/44548', 'name': '44548', 'refsource': 'SECUNIA', 'tags': []}, {'url': 'http://archives.pureftpd.org/archives.cgi?100:mss:3906:201103:cpeojfkblajnpinkeadd', 'name': '[pure-ftpd] 20110308 Pure-FTPd 1.0.30 has been released', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-updates/2011-05/msg00029.html', 'name': '[opensuse-updates] 20110512 openSUSE-SU-2011:0483-1 (moderate): New pure-ftpd version fix STARTTLS issues (CVE-2011-1575).', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://www.pureftpd.org/project/pure-ftpd/news', 'name': 'http://www.pureftpd.org/project/pure-ftpd/news', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://archives.pureftpd.org/archives.cgi?100:mss:3910:201103:cpeojfkblajnpinkeadd', 'name': '[pure-ftpd] 20110308 Re: Pure-FTPd 1.0.30 has been released', 'refsource': 'MLIST', 'tags': ['Patch']}, {'url': 'https://bugzilla.novell.com/show_bug.cgi?id=686590', 'name': 'https://bugzilla.novell.com/show_bug.cgi?id=686590', 'refsource': 'CONFIRM', 'tags': ['Patch']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=683221', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=683221', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://openwall.com/lists/oss-security/2011/04/11/3', 'name': '[oss-security] 20110411 pure-ftpd STARTTLS command injection / new CVE?', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-05/msg00005.html', 'name': 'SUSE-SR:2011:009', 'refsource': 'SUSE', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-399'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97-final:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.19:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.10:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97pre1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98-final:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.95:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97pre4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.2a:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.15:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98pre2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.96.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.95-pre3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97pre3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97pre2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.24:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.7pre2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.26:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.27:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99pre2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.7pre1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.16a:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.14:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.1a:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98pre1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.95-pre2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.95-pre1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.13a:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.18:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.28:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:*:*:*:*:*:*:*:*', 'versionEndIncluding': '1.0.29', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.95-pre4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.16b:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.25:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99b:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99a:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.4:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.7pre3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.96:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.94:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.11:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.16c:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.17:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.2a:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97pre5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.95.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.95.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.91:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.20:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.21:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.6:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.12:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.1b:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99pre1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.90:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.9:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.7:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.97.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.96pre1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.93:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.22:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.17a:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:1.0.5:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.99.3:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.98.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:pureftpd:pure-ftpd:0.92:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'The STARTTLS implementation in ftp_parser.c in Pure-FTPd before 1.0.30 does not properly restrict I/O buffering, which allows man-in-the-middle attackers to insert commands into encrypted FTP sessions by sending a cleartext command that is processed after TLS is in place, related to a "plaintext command injection" attack, a similar issue to CVE-2011-0411.'}]
2014-02-21T04:41Z
2011-05-23T22:55Z
Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
https://cwe.mitre.org/data/definitions/399.html
1
Frank DENIS
2011-03-07 23:50:46+01:00
Flush the command buffer after switching to TLS. Fixes a flaw similar to CVE-2011-0411.
65c4d4ad331e94661de763e9b5304d28698999c4
False
jedisct1/pure-ftpd
Pure FTP server
2009-09-09 10:23:17
2022-07-20 11:08:02
https://www.pureftpd.org
jedisct1
510.0
165.0
sfgets
sfgets( void)
['void']
int sfgets(void) { struct pollfd pfd; int pollret; ssize_t readnb; signed char seen_r = 0; static size_t scanned; static size_t readnbd; if (scanned > (size_t) 0U) { /* support pipelining */ readnbd -= scanned; memmove(cmd, cmd + scanned, readnbd); /* safe */ scanned = (size_t) 0U; } pfd.fd = clientfd; #ifdef __APPLE_CC__ pfd.events = POLLIN | POLLERR | POLLHUP; #else pfd.events = POLLIN | POLLPRI | POLLERR | POLLHUP; #endif while (scanned < cmdsize) { if (scanned >= readnbd) { /* nothing left in the buffer */ pfd.revents = 0; while ((pollret = poll(&pfd, 1U, idletime * 1000UL)) < 0 && errno == EINTR); if (pollret == 0) { return -1; } if (pollret <= 0 || (pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) != 0) { return -2; } if ((pfd.revents & (POLLIN | POLLPRI)) == 0) { continue; } if (readnbd >= cmdsize) { break; } #ifdef WITH_TLS if (tls_cnx != NULL) { while ((readnb = SSL_read (tls_cnx, cmd + readnbd, cmdsize - readnbd)) < (ssize_t) 0 && errno == EINTR); } else #endif { while ((readnb = read(clientfd, cmd + readnbd, cmdsize - readnbd)) < (ssize_t) 0 && errno == EINTR); } if (readnb <= (ssize_t) 0) { return -2; } readnbd += readnb; if (readnbd > cmdsize) { return -2; } } #ifdef RFC_CONFORMANT_LINES if (seen_r != 0) { #endif if (cmd[scanned] == '\n') { #ifndef RFC_CONFORMANT_LINES if (seen_r != 0) { #endif cmd[scanned - 1U] = 0; #ifndef RFC_CONFORMANT_LINES } else { cmd[scanned] = 0; } #endif if (++scanned >= readnbd) { /* non-pipelined command */ scanned = readnbd = (size_t) 0U; } return 0; } seen_r = 0; #ifdef RFC_CONFORMANT_LINES } #endif if (ISCTRLCODE(cmd[scanned])) { if (cmd[scanned] == '\r') { seen_r = 1; } #ifdef RFC_CONFORMANT_PARSER /* disabled by default, intentionnaly */ else if (cmd[scanned] == 0) { cmd[scanned] = '\n'; } #else /* replace control chars with _ */ cmd[scanned] = '_'; #endif } scanned++; } die(421, LOG_WARNING, MSG_LINE_TOO_LONG); /* don't remove this */ return 0; /* to please GCC */ }
447
True
1
CVE-2011-1588
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
LOCAL
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
7.8
HIGH
1.8
5.9
False
[{'url': 'http://lists.opensuse.org/opensuse-security-announce/2011-05/msg00008.html', 'name': 'http://lists.opensuse.org/opensuse-security-announce/2011-05/msg00008.html', 'refsource': 'MISC', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security-tracker.debian.org/tracker/CVE-2011-1588', 'name': 'https://security-tracker.debian.org/tracker/CVE-2011-1588', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1588', 'name': 'https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2011-1588', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://access.redhat.com/security/cve/cve-2011-1588', 'name': 'https://access.redhat.com/security/cve/cve-2011-1588', 'refsource': 'MISC', 'tags': ['Not Applicable', 'Third Party Advisory']}, {'url': 'https://github.com/xfce-mirror/thunar/blob/master/NEWS#L774', 'name': 'https://github.com/xfce-mirror/thunar/blob/master/NEWS#L774', 'refsource': 'MISC', 'tags': []}, {'url': 'https://github.com/xfce-mirror/thunar/commit/03dd312e157d4fa8a11d5fa402706ae5b05806fa', 'name': 'https://github.com/xfce-mirror/thunar/commit/03dd312e157d4fa8a11d5fa402706ae5b05806fa', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-134'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:xfce:thunar:1.2.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:xfce:thunar:1.2.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:opensuse:opensuse:11.4:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'Thunar before 1.3.1 could crash when copy and pasting a file name with % format characters due to a format string error.'}]
2020-08-18T15:05Z
2019-11-14T02:15Z
Use of Externally-Controlled Format String
The software uses a function that accepts a format string as an argument, but the format string originates from an external source.
When an attacker can modify an externally-controlled format string, this can lead to buffer overflows, denial of service, or data representation problems. It should be noted that in some circumstances, such as internationalization, the set of format strings is externally controlled by design. If the source of these format strings is trusted (e.g. only contained in library files that are only modifiable by the system administrator), then the external control might not itself pose a vulnerability.
https://cwe.mitre.org/data/definitions/134.html
0
Lionel Le Folgoc
2011-04-15 13:12:38+02:00
Don't interpret file display names as format strings This avoids a segfault when copying/moving files containing "%" formatters in their name. Signed-off-by: Jannis Pohlmann <[email protected]>
03dd312e157d4fa8a11d5fa402706ae5b05806fa
False
xfce-mirror/thunar
Mirror repository, PRs are not watched, please use Xfce's GitLab
2014-12-01 20:47:45
2022-08-23 19:45:27
https://gitlab.xfce.org/xfce/thunar
xfce-mirror
131.0
56.0
thunar_transfer_job_copy_node
thunar_transfer_job_copy_node( ThunarTransferJob * job , ThunarTransferNode * node , GFile * target_file , GFile * target_parent_file , GList ** target_file_list_return , GError ** error)
['job', 'node', 'target_file', 'target_parent_file', 'target_file_list_return', 'error']
thunar_transfer_job_copy_node (ThunarTransferJob *job, ThunarTransferNode *node, GFile *target_file, GFile *target_parent_file, GList **target_file_list_return, GError **error) { ThunarThumbnailCache *thumbnail_cache; ThunarApplication *application; ThunarJobResponse response; GFileInfo *info; GError *err = NULL; GFile *real_target_file = NULL; gchar *base_name; _thunar_return_if_fail (THUNAR_IS_TRANSFER_JOB (job)); _thunar_return_if_fail (node != NULL && G_IS_FILE (node->source_file)); _thunar_return_if_fail (target_file == NULL || node->next == NULL); _thunar_return_if_fail ((target_file == NULL && target_parent_file != NULL) || (target_file != NULL && target_parent_file == NULL)); _thunar_return_if_fail (error == NULL || *error == NULL); /* The caller can either provide a target_file or a target_parent_file, but not both. The toplevel * transfer_nodes (for which next is NULL) should be called with target_file, to get proper behavior * wrt restoring files from the trash. Other transfer_nodes will be called with target_parent_file. */ /* take a reference on the thumbnail cache */ application = thunar_application_get (); thumbnail_cache = thunar_application_get_thumbnail_cache (application); g_object_unref (application); for (; err == NULL && node != NULL; node = node->next) { /* guess the target file for this node (unless already provided) */ if (G_LIKELY (target_file == NULL)) { base_name = g_file_get_basename (node->source_file); target_file = g_file_get_child (target_parent_file, base_name); g_free (base_name); } else target_file = g_object_ref (target_file); /* query file info */ info = g_file_query_info (node->source_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, exo_job_get_cancellable (EXO_JOB (job)), &err); /* abort on error or cancellation */ if (info == NULL) { g_object_unref (target_file); break; } /* update progress information */ exo_job_info_message (EXO_JOB (job), g_file_info_get_display_name (info)); retry_copy: /* copy the item specified by this node (not recursively) */ real_target_file = thunar_transfer_job_copy_file (job, node->source_file, target_file, &err); if (G_LIKELY (real_target_file != NULL)) { /* node->source_file == real_target_file means to skip the file */ if (G_LIKELY (node->source_file != real_target_file)) { /* notify the thumbnail cache of the copy operation */ thunar_thumbnail_cache_copy_file (thumbnail_cache, node->source_file, real_target_file); /* check if we have children to copy */ if (node->children != NULL) { /* copy all children of this node */ thunar_transfer_job_copy_node (job, node->children, NULL, real_target_file, NULL, &err); /* free resources allocted for the children */ thunar_transfer_node_free (node->children); node->children = NULL; } /* check if the child copy failed */ if (G_UNLIKELY (err != NULL)) { /* outa here, freeing the target paths */ g_object_unref (real_target_file); g_object_unref (target_file); break; } /* add the real target file to the return list */ if (G_LIKELY (target_file_list_return != NULL)) { *target_file_list_return = thunar_g_file_list_prepend (*target_file_list_return, real_target_file); } retry_remove: /* try to remove the source directory if we are on copy+remove fallback for move */ if (job->type == THUNAR_TRANSFER_JOB_MOVE) { if (g_file_delete (node->source_file, exo_job_get_cancellable (EXO_JOB (job)), &err)) { /* notify the thumbnail cache of the delete operation */ thunar_thumbnail_cache_delete_file (thumbnail_cache, node->source_file); } else { /* ask the user to retry */ response = thunar_job_ask_skip (THUNAR_JOB (job), "%s", err->message); /* reset the error */ g_clear_error (&err); /* check whether to retry */ if (G_UNLIKELY (response == THUNAR_JOB_RESPONSE_RETRY)) goto retry_remove; } } } g_object_unref (real_target_file); } else if (err != NULL) { /* we can only skip if there is space left on the device */ if (err->domain != G_IO_ERROR || err->code != G_IO_ERROR_NO_SPACE) { /* ask the user to skip this node and all subnodes */ response = thunar_job_ask_skip (THUNAR_JOB (job), "%s", err->message); /* reset the error */ g_clear_error (&err); /* check whether to retry */ if (G_UNLIKELY (response == THUNAR_JOB_RESPONSE_RETRY)) goto retry_copy; } } /* release the guessed target file */ g_object_unref (target_file); target_file = NULL; /* release file info */ g_object_unref (info); } /* release the thumbnail cache */ g_object_unref (thumbnail_cache); /* propagate error if we failed or the job was cancelled */ if (G_UNLIKELY (err != NULL)) g_propagate_error (error, err); }
578
True
1
CVE-2018-12458
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/e1182fac1afba92a4975917823a5f644bee7e6e8', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/e1182fac1afba92a4975917823a5f644bee7e6e8', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4249', 'name': 'DSA-4249', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/6bbef938839adc55e8e048bc9cc2e0fafe2064df', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/6bbef938839adc55e8e048bc9cc2e0fafe2064df', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-20'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:2.8:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'An improper integer type in the mpeg4_encode_gop_header function in libavcodec/mpeg4videoenc.c in FFmpeg 2.8 and 4.0 may trigger an assertion violation while converting a crafted AVI file to MPEG4, leading to a denial of service.'}]
2021-02-05T21:57Z
2018-06-15T15:29Z
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. 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. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to: raw data - strings, numbers, parameters, file contents, etc. metadata - information about the raw data, such as headers or size Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as: specified quantities such as size, length, frequency, price, rate, number of operations, time, etc. implied or derived quantities, such as the actual size of a file instead of a specified size indexes, offsets, or positions into more complex data structures symbolic keys or other elements into hash tables, associative arrays, etc. well-formedness, i.e. syntactic correctness - compliance with expected syntax lexical token correctness - compliance with rules for what is treated as a token specified or derived type - the actual type of the input (or what the input appears to be) consistency - between individual data elements, between raw data and metadata, between references, etc. conformance to domain-specific rules, e.g. business logic equivalence - ensuring that equivalent inputs are treated the same authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation. Note that "input validation" has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person's last name is inserted into a query. The name "O'Reilly" would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
https://cwe.mitre.org/data/definitions/20.html
0
Michael Niedermayer
2018-05-21 23:08:05+02:00
avcodec/mpeg4videoenc: Use 64 bit for times in mpeg4_encode_gop_header() Fixes truncation Fixes Assertion n <= 31 && value < (1U << n) failed at libavcodec/put_bits.h:169 Fixes: ffmpeg_crash_2.avi Found-by: Thuan Pham <[email protected]>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
e1182fac1afba92a4975917823a5f644bee7e6e8
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
mpeg4_encode_gop_header
mpeg4_encode_gop_header( MpegEncContext * s)
['s']
static void mpeg4_encode_gop_header(MpegEncContext *s) { int hours, minutes, seconds; int64_t time; put_bits(&s->pb, 16, 0); put_bits(&s->pb, 16, GOP_STARTCODE); time = s->current_picture_ptr->f->pts; if (s->reordered_input_picture[1]) time = FFMIN(time, s->reordered_input_picture[1]->f->pts); time = time * s->avctx->time_base.num; s->last_time_base = FFUDIV(time, s->avctx->time_base.den); seconds = FFUDIV(time, s->avctx->time_base.den); minutes = FFUDIV(seconds, 60); seconds = FFUMOD(seconds, 60); hours = FFUDIV(minutes, 60); minutes = FFUMOD(minutes, 60); hours = FFUMOD(hours , 24); put_bits(&s->pb, 5, hours); put_bits(&s->pb, 6, minutes); put_bits(&s->pb, 1, 1); put_bits(&s->pb, 6, seconds); put_bits(&s->pb, 1, !!(s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)); put_bits(&s->pb, 1, 0); // broken link == NO ff_mpeg4_stuffing(&s->pb); }
258
True
1
CVE-2018-12460
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/b3332a182f8ba33a34542e4a0370f38b914ccf7d', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/b3332a182f8ba33a34542e4a0370f38b914ccf7d', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libavcodec in FFmpeg 4.0 may trigger a NULL pointer dereference if the studio profile is incorrectly detected while converting a crafted AVI file to MPEG4, leading to a denial of service, related to idctdsp.c and mpegvideo.c.'}]
2018-08-02T15:10Z
2018-06-15T15:29Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Michael Niedermayer
2018-05-28 21:19:08+02:00
avcodec/idctdsp: Transmit studio_profile to init instead of using AVCodecContext profile These 2 fields are not always the same, it is simpler to always use the same field for detecting studio profile Fixes: null pointer dereference Fixes: ffmpeg_crash_3.avi Found-by: Thuan Pham <[email protected]>, Marcel Böhme, Andrew Santosa and Alexandru RazvanCaciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
b3332a182f8ba33a34542e4a0370f38b914ccf7d
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
ff_idctdsp_init
ff_idctdsp_init( IDCTDSPContext * c , AVCodecContext * avctx)
['c', 'avctx']
av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx) { const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8; if (avctx->lowres==1) { c->idct_put = ff_jref_idct4_put; c->idct_add = ff_jref_idct4_add; c->idct = ff_j_rev_dct4; c->perm_type = FF_IDCT_PERM_NONE; } else if (avctx->lowres==2) { c->idct_put = ff_jref_idct2_put; c->idct_add = ff_jref_idct2_add; c->idct = ff_j_rev_dct2; c->perm_type = FF_IDCT_PERM_NONE; } else if (avctx->lowres==3) { c->idct_put = ff_jref_idct1_put; c->idct_add = ff_jref_idct1_add; c->idct = ff_j_rev_dct1; c->perm_type = FF_IDCT_PERM_NONE; } else { if (avctx->bits_per_raw_sample == 10 || avctx->bits_per_raw_sample == 9) { /* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT However, it only uses idct_put */ if (avctx->codec_id == AV_CODEC_ID_MPEG4 && avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO) c->idct_put = ff_simple_idct_put_int32_10bit; else { c->idct_put = ff_simple_idct_put_int16_10bit; c->idct_add = ff_simple_idct_add_int16_10bit; c->idct = ff_simple_idct_int16_10bit; } c->perm_type = FF_IDCT_PERM_NONE; } else if (avctx->bits_per_raw_sample == 12) { c->idct_put = ff_simple_idct_put_int16_12bit; c->idct_add = ff_simple_idct_add_int16_12bit; c->idct = ff_simple_idct_int16_12bit; c->perm_type = FF_IDCT_PERM_NONE; } else { if (avctx->idct_algo == FF_IDCT_INT) { c->idct_put = ff_jref_idct_put; c->idct_add = ff_jref_idct_add; c->idct = ff_j_rev_dct; c->perm_type = FF_IDCT_PERM_LIBMPEG2; #if CONFIG_FAANIDCT } else if (avctx->idct_algo == FF_IDCT_FAAN) { c->idct_put = ff_faanidct_put; c->idct_add = ff_faanidct_add; c->idct = ff_faanidct; c->perm_type = FF_IDCT_PERM_NONE; #endif /* CONFIG_FAANIDCT */ } else { // accurate/default /* Be sure FF_IDCT_NONE will select this one, since it uses FF_IDCT_PERM_NONE */ c->idct_put = ff_simple_idct_put_int16_8bit; c->idct_add = ff_simple_idct_add_int16_8bit; c->idct = ff_simple_idct_int16_8bit; c->perm_type = FF_IDCT_PERM_NONE; } } } c->put_pixels_clamped = ff_put_pixels_clamped_c; c->put_signed_pixels_clamped = put_signed_pixels_clamped_c; c->add_pixels_clamped = ff_add_pixels_clamped_c; if (CONFIG_MPEG4_DECODER && avctx->idct_algo == FF_IDCT_XVID) ff_xvid_idct_init(c, avctx); if (ARCH_AARCH64) ff_idctdsp_init_aarch64(c, avctx, high_bit_depth); if (ARCH_ALPHA) ff_idctdsp_init_alpha(c, avctx, high_bit_depth); if (ARCH_ARM) ff_idctdsp_init_arm(c, avctx, high_bit_depth); if (ARCH_PPC) ff_idctdsp_init_ppc(c, avctx, high_bit_depth); if (ARCH_X86) ff_idctdsp_init_x86(c, avctx, high_bit_depth); if (ARCH_MIPS) ff_idctdsp_init_mips(c, avctx, high_bit_depth); ff_init_scantable_permutation(c->idct_permutation, c->perm_type); }
450
True
1
CVE-2018-13303
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/00e8181bd97c834fe60751b0c511d4bb97875f78', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/00e8181bd97c834fe60751b0c511d4bb97875f78', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/104675', 'name': '104675', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In FFmpeg 4.0.1, a missing check for failure of a call to init_get_bits8() in the avpriv_ac3_parse_header function in libavcodec/ac3_parser.c may trigger a NULL pointer dereference while converting a crafted AVI file to MPEG4, leading to a denial of service.'}]
2018-07-18T14:34Z
2018-07-05T17:29Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Michael Niedermayer
2018-06-27 16:59:13+02:00
avcodec/ac3_parser: Check init_get_bits8() for failure Fixes: null pointer dereference Fixes: ffmpeg_crash_6.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
00e8181bd97c834fe60751b0c511d4bb97875f78
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
avpriv_ac3_parse_header
avpriv_ac3_parse_header( AC3HeaderInfo ** phdr , const uint8_t * buf , size_t size)
['phdr', 'buf', 'size']
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size) { GetBitContext gb; AC3HeaderInfo *hdr; int err; if (!*phdr) *phdr = av_mallocz(sizeof(AC3HeaderInfo)); if (!*phdr) return AVERROR(ENOMEM); hdr = *phdr; init_get_bits8(&gb, buf, size); err = ff_ac3_parse_header(&gb, hdr); if (err < 0) return AVERROR_INVALIDDATA; return get_bits_count(&gb); }
96
True
1
CVE-2018-13300
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:N/A:P
NETWORK
MEDIUM
NONE
PARTIAL
NONE
PARTIAL
5.8
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
NONE
HIGH
8.1
HIGH
2.8
5.2
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/95556e27e2c1d56d9e18f5db34d6f756f3011148', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/95556e27e2c1d56d9e18f5db34d6f756f3011148', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/104675', 'name': '104675', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://www.debian.org/security/2018/dsa-4249', 'name': 'DSA-4249', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/e6d3fd942f772f54ab6a5ca619cdaadef26b7702', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/e6d3fd942f772f54ab6a5ca619cdaadef26b7702', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In FFmpeg 3.2 and 4.0.1, an improper argument (AVCodecParameters) passed to the avpriv_request_sample function in the handle_eac3 function in libavformat/movenc.c may trigger an out-of-array read while converting a crafted AVI file to MPEG4, leading to a denial of service and possibly an information disclosure.'}]
2021-01-04T18:15Z
2018-07-05T17:29Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Michael Niedermayer
2018-06-27 17:27:50+02:00
avformat/movenc: Do not pass AVCodecParameters in avpriv_request_sample Fixes: out of array read Fixes: ffmpeg_crash_8.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
95556e27e2c1d56d9e18f5db34d6f756f3011148
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
handle_eac3
handle_eac3( MOVMuxContext * mov , AVPacket * pkt , MOVTrack * track)
['mov', 'pkt', 'track']
static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) { AC3HeaderInfo *hdr = NULL; struct eac3_info *info; int num_blocks, ret; if (!track->eac3_priv && !(track->eac3_priv = av_mallocz(sizeof(*info)))) return AVERROR(ENOMEM); info = track->eac3_priv; if (avpriv_ac3_parse_header(&hdr, pkt->data, pkt->size) < 0) { /* drop the packets until we see a good one */ if (!track->entry) { av_log(mov, AV_LOG_WARNING, "Dropping invalid packet from start of the stream\n"); ret = 0; } else ret = AVERROR_INVALIDDATA; goto end; } info->data_rate = FFMAX(info->data_rate, hdr->bit_rate / 1000); num_blocks = hdr->num_blocks; if (!info->ec3_done) { /* AC-3 substream must be the first one */ if (hdr->bitstream_id <= 10 && hdr->substreamid != 0) { ret = AVERROR(EINVAL); goto end; } /* this should always be the case, given that our AC-3 parser * concatenates dependent frames to their independent parent */ if (hdr->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) { /* substream ids must be incremental */ if (hdr->substreamid > info->num_ind_sub + 1) { ret = AVERROR(EINVAL); goto end; } if (hdr->substreamid == info->num_ind_sub + 1) { //info->num_ind_sub++; avpriv_request_sample(track->par, "Multiple independent substreams"); ret = AVERROR_PATCHWELCOME; goto end; } else if (hdr->substreamid < info->num_ind_sub || hdr->substreamid == 0 && info->substream[0].bsid) { info->ec3_done = 1; goto concatenate; } } else { if (hdr->substreamid != 0) { avpriv_request_sample(mov->fc, "Multiple non EAC3 independent substreams"); ret = AVERROR_PATCHWELCOME; goto end; } } /* fill the info needed for the "dec3" atom */ info->substream[hdr->substreamid].fscod = hdr->sr_code; info->substream[hdr->substreamid].bsid = hdr->bitstream_id; info->substream[hdr->substreamid].bsmod = hdr->bitstream_mode; info->substream[hdr->substreamid].acmod = hdr->channel_mode; info->substream[hdr->substreamid].lfeon = hdr->lfe_on; /* Parse dependent substream(s), if any */ if (pkt->size != hdr->frame_size) { int cumul_size = hdr->frame_size; int parent = hdr->substreamid; while (cumul_size != pkt->size) { GetBitContext gbc; int i; ret = avpriv_ac3_parse_header(&hdr, pkt->data + cumul_size, pkt->size - cumul_size); if (ret < 0) goto end; if (hdr->frame_type != EAC3_FRAME_TYPE_DEPENDENT) { ret = AVERROR(EINVAL); goto end; } info->substream[parent].num_dep_sub++; ret /= 8; /* header is parsed up to lfeon, but custom channel map may be needed */ init_get_bits8(&gbc, pkt->data + cumul_size + ret, pkt->size - cumul_size - ret); /* skip bsid */ skip_bits(&gbc, 5); /* skip volume control params */ for (i = 0; i < (hdr->channel_mode ? 1 : 2); i++) { skip_bits(&gbc, 5); // skip dialog normalization if (get_bits1(&gbc)) { skip_bits(&gbc, 8); // skip compression gain word } } /* get the dependent stream channel map, if exists */ if (get_bits1(&gbc)) info->substream[parent].chan_loc |= (get_bits(&gbc, 16) >> 5) & 0x1f; else info->substream[parent].chan_loc |= hdr->channel_mode; cumul_size += hdr->frame_size; } } } concatenate: if (!info->num_blocks && num_blocks == 6) { ret = pkt->size; goto end; } else if (info->num_blocks + num_blocks > 6) { ret = AVERROR_INVALIDDATA; goto end; } if (!info->num_blocks) { ret = av_packet_ref(&info->pkt, pkt); if (!ret) info->num_blocks = num_blocks; goto end; } else { if ((ret = av_grow_packet(&info->pkt, pkt->size)) < 0) goto end; memcpy(info->pkt.data + info->pkt.size - pkt->size, pkt->data, pkt->size); info->num_blocks += num_blocks; info->pkt.duration += pkt->duration; if ((ret = av_copy_packet_side_data(&info->pkt, pkt)) < 0) goto end; if (info->num_blocks != 6) goto end; av_packet_unref(pkt); av_packet_move_ref(pkt, &info->pkt); info->num_blocks = 0; } ret = pkt->size; end: av_free(hdr); return ret; }
834
True
1
CVE-2018-13301
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/2aa9047486dbff12d9e040f917e5f799ed2fd78b', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/2aa9047486dbff12d9e040f917e5f799ed2fd78b', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/104675', 'name': '104675', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In FFmpeg 4.0.1, due to a missing check of a profile value before setting it, the ff_mpeg4_decode_picture_header function in libavcodec/mpeg4videodec.c may trigger a NULL pointer dereference while converting a crafted AVI file to MPEG4, leading to a denial of service.'}]
2018-07-18T14:31Z
2018-07-05T17:29Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Michael Niedermayer
2018-06-27 19:37:09+02:00
avcodec/mpeg4videodec: Check read profile before setting it Fixes: null pointer dereference Fixes: ffmpeg_crash_7.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
2aa9047486dbff12d9e040f917e5f799ed2fd78b
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
ff_mpeg4_decode_picture_header
ff_mpeg4_decode_picture_header( Mpeg4DecContext * ctx , GetBitContext * gb)
['ctx', 'gb']
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; unsigned startcode, v; int ret; int vol = 0; /* search next start code */ align_get_bits(gb); // If we have not switched to studio profile than we also did not switch bps // that means something else (like a previous instance) outside set bps which // would be inconsistant with the currect state, thus reset it if (!s->studio_profile && s->avctx->bits_per_raw_sample != 8) s->avctx->bits_per_raw_sample = 0; if (s->codec_tag == AV_RL32("WV1F") && show_bits(gb, 24) == 0x575630) { skip_bits(gb, 24); if (get_bits(gb, 8) == 0xF0) goto end; } startcode = 0xff; for (;;) { if (get_bits_count(gb) >= gb->size_in_bits) { if (gb->size_in_bits == 8 && (ctx->divx_version >= 0 || ctx->xvid_build >= 0) || s->codec_tag == AV_RL32("QMP4")) { av_log(s->avctx, AV_LOG_VERBOSE, "frame skip %d\n", gb->size_in_bits); return FRAME_SKIPPED; // divx bug } else return AVERROR_INVALIDDATA; // end of stream } /* use the bits after the test */ v = get_bits(gb, 8); startcode = ((startcode << 8) | v) & 0xffffffff; if ((startcode & 0xFFFFFF00) != 0x100) continue; // no startcode if (s->avctx->debug & FF_DEBUG_STARTCODE) { av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X ", startcode); if (startcode <= 0x11F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Start"); else if (startcode <= 0x12F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Layer Start"); else if (startcode <= 0x13F) av_log(s->avctx, AV_LOG_DEBUG, "Reserved"); else if (startcode <= 0x15F) av_log(s->avctx, AV_LOG_DEBUG, "FGS bp start"); else if (startcode <= 0x1AF) av_log(s->avctx, AV_LOG_DEBUG, "Reserved"); else if (startcode == 0x1B0) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq Start"); else if (startcode == 0x1B1) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq End"); else if (startcode == 0x1B2) av_log(s->avctx, AV_LOG_DEBUG, "User Data"); else if (startcode == 0x1B3) av_log(s->avctx, AV_LOG_DEBUG, "Group of VOP start"); else if (startcode == 0x1B4) av_log(s->avctx, AV_LOG_DEBUG, "Video Session Error"); else if (startcode == 0x1B5) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Start"); else if (startcode == 0x1B6) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Plane start"); else if (startcode == 0x1B7) av_log(s->avctx, AV_LOG_DEBUG, "slice start"); else if (startcode == 0x1B8) av_log(s->avctx, AV_LOG_DEBUG, "extension start"); else if (startcode == 0x1B9) av_log(s->avctx, AV_LOG_DEBUG, "fgs start"); else if (startcode == 0x1BA) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object start"); else if (startcode == 0x1BB) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object Plane start"); else if (startcode == 0x1BC) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object start"); else if (startcode == 0x1BD) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object Plane start"); else if (startcode == 0x1BE) av_log(s->avctx, AV_LOG_DEBUG, "Still Texture Object start"); else if (startcode == 0x1BF) av_log(s->avctx, AV_LOG_DEBUG, "Texture Spatial Layer start"); else if (startcode == 0x1C0) av_log(s->avctx, AV_LOG_DEBUG, "Texture SNR Layer start"); else if (startcode == 0x1C1) av_log(s->avctx, AV_LOG_DEBUG, "Texture Tile start"); else if (startcode == 0x1C2) av_log(s->avctx, AV_LOG_DEBUG, "Texture Shape Layer start"); else if (startcode == 0x1C3) av_log(s->avctx, AV_LOG_DEBUG, "stuffing start"); else if (startcode <= 0x1C5) av_log(s->avctx, AV_LOG_DEBUG, "reserved"); else if (startcode <= 0x1FF) av_log(s->avctx, AV_LOG_DEBUG, "System start"); av_log(s->avctx, AV_LOG_DEBUG, " at %d\n", get_bits_count(gb)); } if (startcode >= 0x120 && startcode <= 0x12F) { if (vol) { av_log(s->avctx, AV_LOG_WARNING, "Ignoring multiple VOL headers\n"); continue; } vol++; if ((ret = decode_vol_header(ctx, gb)) < 0) return ret; } else if (startcode == USER_DATA_STARTCODE) { decode_user_data(ctx, gb); } else if (startcode == GOP_STARTCODE) { mpeg4_decode_gop_header(s, gb); } else if (startcode == VOS_STARTCODE) { mpeg4_decode_profile_level(s, gb); if (s->avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO && (s->avctx->level > 0 && s->avctx->level < 9)) { s->studio_profile = 1; next_start_code_studio(gb); extension_and_user_data(s, gb, 0); } } else if (startcode == VISUAL_OBJ_STARTCODE) { if (s->studio_profile) { if ((ret = decode_studiovisualobject(ctx, gb)) < 0) return ret; } else mpeg4_decode_visual_object(s, gb); } else if (startcode == VOP_STARTCODE) { break; } align_get_bits(gb); startcode = 0xff; } end: if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) s->low_delay = 1; s->avctx->has_b_frames = !s->low_delay; if (s->studio_profile) { if (!s->avctx->bits_per_raw_sample) { av_log(s->avctx, AV_LOG_ERROR, "Missing VOL header\n"); return AVERROR_INVALIDDATA; } return decode_studio_vop_header(ctx, gb); } else return decode_vop_header(ctx, gb); }
1038
True
1
CVE-2018-13301
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/2aa9047486dbff12d9e040f917e5f799ed2fd78b', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/2aa9047486dbff12d9e040f917e5f799ed2fd78b', 'refsource': 'MISC', 'tags': ['Patch']}, {'url': 'http://www.securityfocus.com/bid/104675', 'name': '104675', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In FFmpeg 4.0.1, due to a missing check of a profile value before setting it, the ff_mpeg4_decode_picture_header function in libavcodec/mpeg4videodec.c may trigger a NULL pointer dereference while converting a crafted AVI file to MPEG4, leading to a denial of service.'}]
2018-07-18T14:31Z
2018-07-05T17:29Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Michael Niedermayer
2018-06-27 19:37:09+02:00
avcodec/mpeg4videodec: Check read profile before setting it Fixes: null pointer dereference Fixes: ffmpeg_crash_7.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
2aa9047486dbff12d9e040f917e5f799ed2fd78b
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
mpeg4_decode_profile_level
mpeg4_decode_profile_level( MpegEncContext * s , GetBitContext * gb)
['s', 'gb']
static int mpeg4_decode_profile_level(MpegEncContext *s, GetBitContext *gb) { s->avctx->profile = get_bits(gb, 4); s->avctx->level = get_bits(gb, 4); // for Simple profile, level 0 if (s->avctx->profile == 0 && s->avctx->level == 8) { s->avctx->level = 0; } return 0; }
69
True
1
CVE-2018-13304
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libavcodec in FFmpeg 4.0.1, improper maintenance of the consistency between the context profile field and studio_profile in libavcodec may trigger an assertion failure while converting a crafted AVI file to MPEG4, leading to a denial of service, related to error_resilience.c, h263dec.c, and mpeg4videodec.c.'}]
2019-10-03T00:03Z
2018-07-05T17:29Z
Reachable Assertion
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.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. 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.
https://cwe.mitre.org/data/definitions/617.html
0
Michael Niedermayer
2018-07-03 00:27:04+02:00
avcodec/mpeg4videodec: Remove use of FF_PROFILE_MPEG4_SIMPLE_STUDIO as indicator of studio profile The profile field is changed by code inside and outside the decoder, its not a reliable indicator of the internal codec state. Maintaining it consistency with studio_profile is messy. Its easier to just avoid it and use only studio_profile Fixes: assertion failure Fixes: ffmpeg_crash_9.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
bd27a9364ca274ca97f1df6d984e88a0700fb235
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
er_supported
er_supported( ERContext * s)
['s']
static int er_supported(ERContext *s) { if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice || !s->cur_pic.f || s->cur_pic.field_picture || s->avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO ) return 0; return 1; }
51
True
1
CVE-2018-13304
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libavcodec in FFmpeg 4.0.1, improper maintenance of the consistency between the context profile field and studio_profile in libavcodec may trigger an assertion failure while converting a crafted AVI file to MPEG4, leading to a denial of service, related to error_resilience.c, h263dec.c, and mpeg4videodec.c.'}]
2019-10-03T00:03Z
2018-07-05T17:29Z
Reachable Assertion
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.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. 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.
https://cwe.mitre.org/data/definitions/617.html
0
Michael Niedermayer
2018-07-03 00:27:04+02:00
avcodec/mpeg4videodec: Remove use of FF_PROFILE_MPEG4_SIMPLE_STUDIO as indicator of studio profile The profile field is changed by code inside and outside the decoder, its not a reliable indicator of the internal codec state. Maintaining it consistency with studio_profile is messy. Its easier to just avoid it and use only studio_profile Fixes: assertion failure Fixes: ffmpeg_crash_9.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
bd27a9364ca274ca97f1df6d984e88a0700fb235
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
ff_h263_decode_frame
ff_h263_decode_frame( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt)
['avctx', 'data', 'got_frame', 'avpkt']
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; int slice_ret = 0; AVFrame *pict = data; /* no supplementary picture */ if (buf_size == 0) { /* special case for last picture */ if (s->low_delay == 0 && s->next_picture_ptr) { if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0) return ret; s->next_picture_ptr = NULL; *got_frame = 1; } return 0; } if (s->avctx->flags & AV_CODEC_FLAG_TRUNCATED) { int next; if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) { next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size); } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) { next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) { next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); } else { av_log(s->avctx, AV_LOG_ERROR, "this codec does not support truncated bitstreams\n"); return AVERROR(ENOSYS); } if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf, &buf_size) < 0) return buf_size; } retry: if (s->divx_packed && s->bitstream_buffer_size) { int i; for(i=0; i < buf_size-3; i++) { if (buf[i]==0 && buf[i+1]==0 && buf[i+2]==1) { if (buf[i+3]==0xB0) { av_log(s->avctx, AV_LOG_WARNING, "Discarding excessive bitstream in packed xvid\n"); s->bitstream_buffer_size = 0; } break; } } } if (s->bitstream_buffer_size && (s->divx_packed || buf_size <= MAX_NVOP_SIZE)) // divx 5.01+/xvid frame reorder ret = init_get_bits8(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size); else ret = init_get_bits8(&s->gb, buf, buf_size); s->bitstream_buffer_size = 0; if (ret < 0) return ret; if (!s->context_initialized) // we need the idct permutation for reading a custom matrix ff_mpv_idct_init(s); /* let's go :-) */ if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) { ret = ff_wmv2_decode_picture_header(s); } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) { ret = ff_msmpeg4_decode_picture_header(s); } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { if (s->avctx->extradata_size && s->picture_number == 0) { GetBitContext gb; if (init_get_bits8(&gb, s->avctx->extradata, s->avctx->extradata_size) >= 0 ) ff_mpeg4_decode_picture_header(avctx->priv_data, &gb); } ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb); } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) { ret = ff_intel_h263_decode_picture_header(s); } else if (CONFIG_FLV_DECODER && s->h263_flv) { ret = ff_flv_decode_picture_header(s); } else { ret = ff_h263_decode_picture_header(s); } if (ret < 0 || ret == FRAME_SKIPPED) { if ( s->width != avctx->coded_width || s->height != avctx->coded_height) { av_log(s->avctx, AV_LOG_WARNING, "Reverting picture dimensions change due to header decoding failure\n"); s->width = avctx->coded_width; s->height= avctx->coded_height; } } if (ret == FRAME_SKIPPED) return get_consumed_bytes(s, buf_size); /* skip if the header was thrashed */ if (ret < 0) { av_log(s->avctx, AV_LOG_ERROR, "header damaged\n"); return ret; } if (!s->context_initialized) { avctx->pix_fmt = h263_get_format(avctx); if ((ret = ff_mpv_common_init(s)) < 0) return ret; } if (!s->current_picture_ptr || s->current_picture_ptr->f->data[0]) { int i = ff_find_unused_picture(s->avctx, s->picture, 0); if (i < 0) return i; s->current_picture_ptr = &s->picture[i]; } avctx->has_b_frames = !s->low_delay; if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { if (ff_mpeg4_workaround_bugs(avctx) == 1) goto retry; if (s->studio_profile != (s->idsp.idct == NULL)) ff_mpv_idct_init(s); } /* After H.263 & MPEG-4 header decode we have the height, width, * and other parameters. So then we could init the picture. * FIXME: By the way H.263 decoder is evolving it should have * an H263EncContext */ if (s->width != avctx->coded_width || s->height != avctx->coded_height || s->context_reinit) { /* H.263 could change picture size any time */ s->context_reinit = 0; ret = ff_set_dimensions(avctx, s->width, s->height); if (ret < 0) return ret; ff_set_sar(avctx, avctx->sample_aspect_ratio); if ((ret = ff_mpv_common_frame_size_change(s))) return ret; if (avctx->pix_fmt != h263_get_format(avctx)) { av_log(avctx, AV_LOG_ERROR, "format change not supported\n"); avctx->pix_fmt = AV_PIX_FMT_NONE; return AVERROR_UNKNOWN; } } if (s->codec_id == AV_CODEC_ID_H263 || s->codec_id == AV_CODEC_ID_H263P || s->codec_id == AV_CODEC_ID_H263I) s->gob_index = H263_GOB_HEIGHT(s->height); // for skipping the frame s->current_picture.f->pict_type = s->pict_type; s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I; /* skip B-frames if we don't have reference frames */ if (!s->last_picture_ptr && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) return get_consumed_bytes(s, buf_size); if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) || avctx->skip_frame >= AVDISCARD_ALL) return get_consumed_bytes(s, buf_size); if (s->next_p_frame_damaged) { if (s->pict_type == AV_PICTURE_TYPE_B) return get_consumed_bytes(s, buf_size); else s->next_p_frame_damaged = 0; } if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { s->me.qpel_put = s->qdsp.put_qpel_pixels_tab; s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab; } else { s->me.qpel_put = s->qdsp.put_no_rnd_qpel_pixels_tab; s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab; } if ((ret = ff_mpv_frame_start(s, avctx)) < 0) return ret; if (!s->divx_packed) ff_thread_finish_setup(avctx); if (avctx->hwaccel) { ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); if (ret < 0 ) return ret; } ff_mpeg_er_frame_start(s); /* the second part of the wmv2 header contains the MB skip bits which * are stored in current_picture->mb_type which is not available before * ff_mpv_frame_start() */ if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) { ret = ff_wmv2_decode_secondary_picture_header(s); if (ret < 0) return ret; if (ret == 1) goto frame_end; } /* decode each macroblock */ s->mb_x = 0; s->mb_y = 0; slice_ret = decode_slice(s); while (s->mb_y < s->mb_height) { if (s->msmpeg4_version) { if (s->slice_height == 0 || s->mb_x != 0 || slice_ret < 0 || (s->mb_y % s->slice_height) != 0 || get_bits_left(&s->gb) < 0) break; } else { int prev_x = s->mb_x, prev_y = s->mb_y; if (ff_h263_resync(s) < 0) break; if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x) s->er.error_occurred = 1; } if (s->msmpeg4_version < 4 && s->h263_pred) ff_mpeg4_clean_buffers(s); if (decode_slice(s) < 0) slice_ret = AVERROR_INVALIDDATA; } if (s->msmpeg4_version && s->msmpeg4_version < 4 && s->pict_type == AV_PICTURE_TYPE_I) if (!CONFIG_MSMPEG4_DECODER || ff_msmpeg4_decode_ext_header(s, buf_size) < 0) s->er.error_status_table[s->mb_num - 1] = ER_MB_ERROR; av_assert1(s->bitstream_buffer_size == 0); frame_end: ff_er_frame_end(&s->er); if (avctx->hwaccel) { ret = avctx->hwaccel->end_frame(avctx); if (ret < 0) return ret; } ff_mpv_frame_end(s); if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) ff_mpeg4_frame_end(avctx, buf, buf_size); if (!s->divx_packed && avctx->hwaccel) ff_thread_finish_setup(avctx); av_assert1(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); av_assert1(s->current_picture.f->pict_type == s->pict_type); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0) return ret; ff_print_debug_info(s, s->current_picture_ptr, pict); ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_QSCALE_TYPE_MPEG1); } else if (s->last_picture_ptr) { if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0) return ret; ff_print_debug_info(s, s->last_picture_ptr, pict); ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_QSCALE_TYPE_MPEG1); } if (s->last_picture_ptr || s->low_delay) { if ( pict->format == AV_PIX_FMT_YUV420P && (s->codec_tag == AV_RL32("GEOV") || s->codec_tag == AV_RL32("GEOX"))) { int x, y, p; av_frame_make_writable(pict); for (p=0; p<3; p++) { int w = AV_CEIL_RSHIFT(pict-> width, !!p); int h = AV_CEIL_RSHIFT(pict->height, !!p); int linesize = pict->linesize[p]; for (y=0; y<(h>>1); y++) for (x=0; x<w; x++) FFSWAP(int, pict->data[p][x + y*linesize], pict->data[p][x + (h-1-y)*linesize]); } } *got_frame = 1; } if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) return slice_ret; else return get_consumed_bytes(s, buf_size); }
1945
True
1
CVE-2018-13304
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libavcodec in FFmpeg 4.0.1, improper maintenance of the consistency between the context profile field and studio_profile in libavcodec may trigger an assertion failure while converting a crafted AVI file to MPEG4, leading to a denial of service, related to error_resilience.c, h263dec.c, and mpeg4videodec.c.'}]
2019-10-03T00:03Z
2018-07-05T17:29Z
Reachable Assertion
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.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. 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.
https://cwe.mitre.org/data/definitions/617.html
0
Michael Niedermayer
2018-07-03 00:27:04+02:00
avcodec/mpeg4videodec: Remove use of FF_PROFILE_MPEG4_SIMPLE_STUDIO as indicator of studio profile The profile field is changed by code inside and outside the decoder, its not a reliable indicator of the internal codec state. Maintaining it consistency with studio_profile is messy. Its easier to just avoid it and use only studio_profile Fixes: assertion failure Fixes: ffmpeg_crash_9.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
bd27a9364ca274ca97f1df6d984e88a0700fb235
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
h263_get_format
h263_get_format( AVCodecContext * avctx)
['avctx']
static enum AVPixelFormat h263_get_format(AVCodecContext *avctx) { /* MPEG-4 Studio Profile only, not supported by hardware */ if (avctx->bits_per_raw_sample > 8) { av_assert1(avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO); return avctx->pix_fmt; } if (avctx->codec->id == AV_CODEC_ID_MSS2) return AV_PIX_FMT_YUV420P; if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) { if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED) avctx->color_range = AVCOL_RANGE_MPEG; return AV_PIX_FMT_GRAY8; } return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); }
92
True
1
CVE-2018-13304
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/bd27a9364ca274ca97f1df6d984e88a0700fb235', 'refsource': 'MISC', 'tags': ['Patch']}]
[{'description': [{'lang': 'en', 'value': 'CWE-617'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In libavcodec in FFmpeg 4.0.1, improper maintenance of the consistency between the context profile field and studio_profile in libavcodec may trigger an assertion failure while converting a crafted AVI file to MPEG4, leading to a denial of service, related to error_resilience.c, h263dec.c, and mpeg4videodec.c.'}]
2019-10-03T00:03Z
2018-07-05T17:29Z
Reachable Assertion
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.
While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service. 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.
https://cwe.mitre.org/data/definitions/617.html
0
Michael Niedermayer
2018-07-03 00:27:04+02:00
avcodec/mpeg4videodec: Remove use of FF_PROFILE_MPEG4_SIMPLE_STUDIO as indicator of studio profile The profile field is changed by code inside and outside the decoder, its not a reliable indicator of the internal codec state. Maintaining it consistency with studio_profile is messy. Its easier to just avoid it and use only studio_profile Fixes: assertion failure Fixes: ffmpeg_crash_9.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <[email protected]>
bd27a9364ca274ca97f1df6d984e88a0700fb235
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
ff_mpeg4_decode_picture_header
ff_mpeg4_decode_picture_header( Mpeg4DecContext * ctx , GetBitContext * gb)
['ctx', 'gb']
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; unsigned startcode, v; int ret; int vol = 0; /* search next start code */ align_get_bits(gb); // If we have not switched to studio profile than we also did not switch bps // that means something else (like a previous instance) outside set bps which // would be inconsistant with the currect state, thus reset it if (!s->studio_profile && s->avctx->bits_per_raw_sample != 8) s->avctx->bits_per_raw_sample = 0; if (s->codec_tag == AV_RL32("WV1F") && show_bits(gb, 24) == 0x575630) { skip_bits(gb, 24); if (get_bits(gb, 8) == 0xF0) goto end; } startcode = 0xff; for (;;) { if (get_bits_count(gb) >= gb->size_in_bits) { if (gb->size_in_bits == 8 && (ctx->divx_version >= 0 || ctx->xvid_build >= 0) || s->codec_tag == AV_RL32("QMP4")) { av_log(s->avctx, AV_LOG_VERBOSE, "frame skip %d\n", gb->size_in_bits); return FRAME_SKIPPED; // divx bug } else return AVERROR_INVALIDDATA; // end of stream } /* use the bits after the test */ v = get_bits(gb, 8); startcode = ((startcode << 8) | v) & 0xffffffff; if ((startcode & 0xFFFFFF00) != 0x100) continue; // no startcode if (s->avctx->debug & FF_DEBUG_STARTCODE) { av_log(s->avctx, AV_LOG_DEBUG, "startcode: %3X ", startcode); if (startcode <= 0x11F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Start"); else if (startcode <= 0x12F) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Layer Start"); else if (startcode <= 0x13F) av_log(s->avctx, AV_LOG_DEBUG, "Reserved"); else if (startcode <= 0x15F) av_log(s->avctx, AV_LOG_DEBUG, "FGS bp start"); else if (startcode <= 0x1AF) av_log(s->avctx, AV_LOG_DEBUG, "Reserved"); else if (startcode == 0x1B0) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq Start"); else if (startcode == 0x1B1) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Seq End"); else if (startcode == 0x1B2) av_log(s->avctx, AV_LOG_DEBUG, "User Data"); else if (startcode == 0x1B3) av_log(s->avctx, AV_LOG_DEBUG, "Group of VOP start"); else if (startcode == 0x1B4) av_log(s->avctx, AV_LOG_DEBUG, "Video Session Error"); else if (startcode == 0x1B5) av_log(s->avctx, AV_LOG_DEBUG, "Visual Object Start"); else if (startcode == 0x1B6) av_log(s->avctx, AV_LOG_DEBUG, "Video Object Plane start"); else if (startcode == 0x1B7) av_log(s->avctx, AV_LOG_DEBUG, "slice start"); else if (startcode == 0x1B8) av_log(s->avctx, AV_LOG_DEBUG, "extension start"); else if (startcode == 0x1B9) av_log(s->avctx, AV_LOG_DEBUG, "fgs start"); else if (startcode == 0x1BA) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object start"); else if (startcode == 0x1BB) av_log(s->avctx, AV_LOG_DEBUG, "FBA Object Plane start"); else if (startcode == 0x1BC) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object start"); else if (startcode == 0x1BD) av_log(s->avctx, AV_LOG_DEBUG, "Mesh Object Plane start"); else if (startcode == 0x1BE) av_log(s->avctx, AV_LOG_DEBUG, "Still Texture Object start"); else if (startcode == 0x1BF) av_log(s->avctx, AV_LOG_DEBUG, "Texture Spatial Layer start"); else if (startcode == 0x1C0) av_log(s->avctx, AV_LOG_DEBUG, "Texture SNR Layer start"); else if (startcode == 0x1C1) av_log(s->avctx, AV_LOG_DEBUG, "Texture Tile start"); else if (startcode == 0x1C2) av_log(s->avctx, AV_LOG_DEBUG, "Texture Shape Layer start"); else if (startcode == 0x1C3) av_log(s->avctx, AV_LOG_DEBUG, "stuffing start"); else if (startcode <= 0x1C5) av_log(s->avctx, AV_LOG_DEBUG, "reserved"); else if (startcode <= 0x1FF) av_log(s->avctx, AV_LOG_DEBUG, "System start"); av_log(s->avctx, AV_LOG_DEBUG, " at %d\n", get_bits_count(gb)); } if (startcode >= 0x120 && startcode <= 0x12F) { if (vol) { av_log(s->avctx, AV_LOG_WARNING, "Ignoring multiple VOL headers\n"); continue; } vol++; if ((ret = decode_vol_header(ctx, gb)) < 0) return ret; } else if (startcode == USER_DATA_STARTCODE) { decode_user_data(ctx, gb); } else if (startcode == GOP_STARTCODE) { mpeg4_decode_gop_header(s, gb); } else if (startcode == VOS_STARTCODE) { int profile, level; mpeg4_decode_profile_level(s, gb, &profile, &level); if (profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO && (level > 0 && level < 9)) { s->studio_profile = 1; next_start_code_studio(gb); extension_and_user_data(s, gb, 0); } else if (s->studio_profile) { avpriv_request_sample(s->avctx, "Mixes studio and non studio profile\n"); return AVERROR_PATCHWELCOME; } s->avctx->profile = profile; s->avctx->level = level; } else if (startcode == VISUAL_OBJ_STARTCODE) { if (s->studio_profile) { if ((ret = decode_studiovisualobject(ctx, gb)) < 0) return ret; } else mpeg4_decode_visual_object(s, gb); } else if (startcode == VOP_STARTCODE) { break; } align_get_bits(gb); startcode = 0xff; } end: if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) s->low_delay = 1; s->avctx->has_b_frames = !s->low_delay; if (s->studio_profile) { av_assert0(s->avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO); if (!s->avctx->bits_per_raw_sample) { av_log(s->avctx, AV_LOG_ERROR, "Missing VOL header\n"); return AVERROR_INVALIDDATA; } return decode_studio_vop_header(ctx, gb); } else return decode_vop_header(ctx, gb); }
1085
True
1
CVE-2018-1999015
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:N/A:N
NETWORK
MEDIUM
NONE
PARTIAL
NONE
NONE
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
NONE
NONE
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/5aba5b89d0b1d73164d3b81764828bb8b20ff32a', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/5aba5b89d0b1d73164d3b81764828bb8b20ff32a', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/104896', 'name': '104896', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '4.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'FFmpeg before commit 5aba5b89d0b1d73164d3b81764828bb8b20ff32a contains an out of array read vulnerability in ASF_F format demuxer that can result in heap memory reading. This attack appear to be exploitable via specially crafted ASF file that has to provided as input. This vulnerability appears to have been fixed in 5aba5b89d0b1d73164d3b81764828bb8b20ff32a and later.'}]
2018-09-20T16:22Z
2018-07-23T15:29Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Michael Niedermayer
2018-07-03 22:48:32+02:00
avcodec/mpeg4videodec: Check for bitstream end in read_quant_matrix_ext() Fixes: out of array read Fixes: asff-crash-0e53d0dc491dfdd507530b66562812fbd4c36678 Found-by: Paul Ch <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
5aba5b89d0b1d73164d3b81764828bb8b20ff32a
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
read_quant_matrix_ext
read_quant_matrix_ext( MpegEncContext * s , GetBitContext * gb)
['s', 'gb']
static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb) { int i, j, v; if (get_bits1(gb)) { /* intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->idsp.idct_permutation[ff_zigzag_direct[i]]; s->intra_matrix[j] = v; s->chroma_intra_matrix[j] = v; } } if (get_bits1(gb)) { /* non_intra_quantiser_matrix */ for (i = 0; i < 64; i++) { get_bits(gb, 8); } } if (get_bits1(gb)) { /* chroma_intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->idsp.idct_permutation[ff_zigzag_direct[i]]; s->chroma_intra_matrix[j] = v; } } if (get_bits1(gb)) { /* chroma_non_intra_quantiser_matrix */ for (i = 0; i < 64; i++) { get_bits(gb, 8); } } next_start_code_studio(gb); }
207
True
1
CVE-2018-1999014
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/104896', 'name': '104896', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '4.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'FFmpeg before commit bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75 contains an out of array access vulnerability in MXF format demuxer that can result in DoS. This attack appear to be exploitable via specially crafted MXF file which has to be provided as input. This vulnerability appears to have been fixed in bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75 and later.'}]
2018-09-19T17:56Z
2018-07-23T15:29Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Michael Niedermayer
2018-07-03 20:38:06+02:00
avformat/mxfdec: Fix av_log context Fixes: out of array access Fixes: mxf-crash-1c2e59bf07a34675bfb3ada5e1ec22fa9f38f923 Found-by: Paul Ch <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
mxf_parse_structural_metadata
mxf_parse_structural_metadata( MXFContext * mxf)
['mxf']
static int mxf_parse_structural_metadata(MXFContext *mxf) { MXFPackage *material_package = NULL; int i, j, k, ret; av_log(mxf->fc, AV_LOG_TRACE, "metadata sets count %d\n", mxf->metadata_sets_count); /* TODO: handle multiple material packages (OP3x) */ for (i = 0; i < mxf->packages_count; i++) { material_package = mxf_resolve_strong_ref(mxf, &mxf->packages_refs[i], MaterialPackage); if (material_package) break; } if (!material_package) { av_log(mxf->fc, AV_LOG_ERROR, "no material package found\n"); return AVERROR_INVALIDDATA; } mxf_add_umid_metadata(&mxf->fc->metadata, "material_package_umid", material_package); if (material_package->name && material_package->name[0]) av_dict_set(&mxf->fc->metadata, "material_package_name", material_package->name, 0); mxf_parse_package_comments(mxf, &mxf->fc->metadata, material_package); for (i = 0; i < material_package->tracks_count; i++) { MXFPackage *source_package = NULL; MXFTrack *material_track = NULL; MXFTrack *source_track = NULL; MXFTrack *temp_track = NULL; MXFDescriptor *descriptor = NULL; MXFStructuralComponent *component = NULL; MXFTimecodeComponent *mxf_tc = NULL; UID *essence_container_ul = NULL; const MXFCodecUL *codec_ul = NULL; const MXFCodecUL *container_ul = NULL; const MXFCodecUL *pix_fmt_ul = NULL; AVStream *st; AVTimecode tc; int flags; if (!(material_track = mxf_resolve_strong_ref(mxf, &material_package->tracks_refs[i], Track))) { av_log(mxf->fc, AV_LOG_ERROR, "could not resolve material track strong ref\n"); continue; } if ((component = mxf_resolve_strong_ref(mxf, &material_track->sequence_ref, TimecodeComponent))) { mxf_tc = (MXFTimecodeComponent*)component; flags = mxf_tc->drop_frame == 1 ? AV_TIMECODE_FLAG_DROPFRAME : 0; if (av_timecode_init(&tc, mxf_tc->rate, flags, mxf_tc->start_frame, mxf->fc) == 0) { mxf_add_timecode_metadata(&mxf->fc->metadata, "timecode", &tc); } } if (!(material_track->sequence = mxf_resolve_strong_ref(mxf, &material_track->sequence_ref, Sequence))) { av_log(mxf->fc, AV_LOG_ERROR, "could not resolve material track sequence strong ref\n"); continue; } for (j = 0; j < material_track->sequence->structural_components_count; j++) { component = mxf_resolve_strong_ref(mxf, &material_track->sequence->structural_components_refs[j], TimecodeComponent); if (!component) continue; mxf_tc = (MXFTimecodeComponent*)component; flags = mxf_tc->drop_frame == 1 ? AV_TIMECODE_FLAG_DROPFRAME : 0; if (av_timecode_init(&tc, mxf_tc->rate, flags, mxf_tc->start_frame, mxf->fc) == 0) { mxf_add_timecode_metadata(&mxf->fc->metadata, "timecode", &tc); break; } } /* TODO: handle multiple source clips, only finds first valid source clip */ if(material_track->sequence->structural_components_count > 1) av_log(mxf->fc, AV_LOG_WARNING, "material track %d: has %d components\n", material_track->track_id, material_track->sequence->structural_components_count); for (j = 0; j < material_track->sequence->structural_components_count; j++) { component = mxf_resolve_sourceclip(mxf, &material_track->sequence->structural_components_refs[j]); if (!component) continue; source_package = mxf_resolve_source_package(mxf, component->source_package_ul, component->source_package_uid); if (!source_package) { av_log(mxf->fc, AV_LOG_TRACE, "material track %d: no corresponding source package found\n", material_track->track_id); continue; } for (k = 0; k < source_package->tracks_count; k++) { if (!(temp_track = mxf_resolve_strong_ref(mxf, &source_package->tracks_refs[k], Track))) { av_log(mxf->fc, AV_LOG_ERROR, "could not resolve source track strong ref\n"); ret = AVERROR_INVALIDDATA; goto fail_and_free; } if (temp_track->track_id == component->source_track_id) { source_track = temp_track; break; } } if (!source_track) { av_log(mxf->fc, AV_LOG_ERROR, "material track %d: no corresponding source track found\n", material_track->track_id); break; } for (k = 0; k < mxf->essence_container_data_count; k++) { MXFEssenceContainerData *essence_data; if (!(essence_data = mxf_resolve_strong_ref(mxf, &mxf->essence_container_data_refs[k], EssenceContainerData))) { av_log(mxf, AV_LOG_TRACE, "could not resolve essence container data strong ref\n"); continue; } if (!memcmp(component->source_package_ul, essence_data->package_ul, sizeof(UID)) && !memcmp(component->source_package_uid, essence_data->package_uid, sizeof(UID))) { source_track->body_sid = essence_data->body_sid; source_track->index_sid = essence_data->index_sid; break; } } if(source_track && component) break; } if (!source_track || !component || !source_package) { if((ret = mxf_add_metadata_stream(mxf, material_track))) goto fail_and_free; continue; } if (!(source_track->sequence = mxf_resolve_strong_ref(mxf, &source_track->sequence_ref, Sequence))) { av_log(mxf->fc, AV_LOG_ERROR, "could not resolve source track sequence strong ref\n"); ret = AVERROR_INVALIDDATA; goto fail_and_free; } /* 0001GL00.MXF.A1.mxf_opatom.mxf has the same SourcePackageID as 0001GL.MXF.V1.mxf_opatom.mxf * This would result in both files appearing to have two streams. Work around this by sanity checking DataDefinition */ if (memcmp(material_track->sequence->data_definition_ul, source_track->sequence->data_definition_ul, 16)) { av_log(mxf->fc, AV_LOG_ERROR, "material track %d: DataDefinition mismatch\n", material_track->track_id); continue; } st = avformat_new_stream(mxf->fc, NULL); if (!st) { av_log(mxf->fc, AV_LOG_ERROR, "could not allocate stream\n"); ret = AVERROR(ENOMEM); goto fail_and_free; } st->id = material_track->track_id; st->priv_data = source_track; source_package->descriptor = mxf_resolve_strong_ref(mxf, &source_package->descriptor_ref, AnyType); descriptor = mxf_resolve_multidescriptor(mxf, source_package->descriptor, source_track->track_id); /* A SourceClip from a EssenceGroup may only be a single frame of essence data. The clips duration is then how many * frames its suppose to repeat for. Descriptor->duration, if present, contains the real duration of the essence data */ if (descriptor && descriptor->duration != AV_NOPTS_VALUE) source_track->original_duration = st->duration = FFMIN(descriptor->duration, component->duration); else source_track->original_duration = st->duration = component->duration; if (st->duration == -1) st->duration = AV_NOPTS_VALUE; st->start_time = component->start_position; if (material_track->edit_rate.num <= 0 || material_track->edit_rate.den <= 0) { av_log(mxf->fc, AV_LOG_WARNING, "Invalid edit rate (%d/%d) found on stream #%d, " "defaulting to 25/1\n", material_track->edit_rate.num, material_track->edit_rate.den, st->index); material_track->edit_rate = (AVRational){25, 1}; } avpriv_set_pts_info(st, 64, material_track->edit_rate.den, material_track->edit_rate.num); /* ensure SourceTrack EditRate == MaterialTrack EditRate since only * the former is accessible via st->priv_data */ source_track->edit_rate = material_track->edit_rate; PRINT_KEY(mxf->fc, "data definition ul", source_track->sequence->data_definition_ul); codec_ul = mxf_get_codec_ul(ff_mxf_data_definition_uls, &source_track->sequence->data_definition_ul); st->codecpar->codec_type = codec_ul->id; if (!descriptor) { av_log(mxf->fc, AV_LOG_INFO, "source track %d: stream %d, no descriptor found\n", source_track->track_id, st->index); continue; } PRINT_KEY(mxf->fc, "essence codec ul", descriptor->essence_codec_ul); PRINT_KEY(mxf->fc, "essence container ul", descriptor->essence_container_ul); essence_container_ul = &descriptor->essence_container_ul; source_track->wrapping = (mxf->op == OPAtom) ? ClipWrapped : mxf_get_wrapping_kind(essence_container_ul); if (source_track->wrapping == UnknownWrapped) av_log(mxf->fc, AV_LOG_INFO, "wrapping of stream %d is unknown\n", st->index); /* HACK: replacing the original key with mxf_encrypted_essence_container * is not allowed according to s429-6, try to find correct information anyway */ if (IS_KLV_KEY(essence_container_ul, mxf_encrypted_essence_container)) { av_log(mxf->fc, AV_LOG_INFO, "broken encrypted mxf file\n"); for (k = 0; k < mxf->metadata_sets_count; k++) { MXFMetadataSet *metadata = mxf->metadata_sets[k]; if (metadata->type == CryptoContext) { essence_container_ul = &((MXFCryptoContext *)metadata)->source_container_ul; break; } } } /* TODO: drop PictureEssenceCoding and SoundEssenceCompression, only check EssenceContainer */ codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->essence_codec_ul); st->codecpar->codec_id = (enum AVCodecID)codec_ul->id; if (st->codecpar->codec_id == AV_CODEC_ID_NONE) { codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->codec_ul); st->codecpar->codec_id = (enum AVCodecID)codec_ul->id; } av_log(mxf->fc, AV_LOG_VERBOSE, "%s: Universal Label: ", avcodec_get_name(st->codecpar->codec_id)); for (k = 0; k < 16; k++) { av_log(mxf->fc, AV_LOG_VERBOSE, "%.2x", descriptor->essence_codec_ul[k]); if (!(k+1 & 19) || k == 5) av_log(mxf->fc, AV_LOG_VERBOSE, "."); } av_log(mxf->fc, AV_LOG_VERBOSE, "\n"); mxf_add_umid_metadata(&st->metadata, "file_package_umid", source_package); if (source_package->name && source_package->name[0]) av_dict_set(&st->metadata, "file_package_name", source_package->name, 0); if (material_track->name && material_track->name[0]) av_dict_set(&st->metadata, "track_name", material_track->name, 0); mxf_parse_physical_source_package(mxf, source_track, st); if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { source_track->intra_only = mxf_is_intra_only(descriptor); container_ul = mxf_get_codec_ul(mxf_picture_essence_container_uls, essence_container_ul); if (st->codecpar->codec_id == AV_CODEC_ID_NONE) st->codecpar->codec_id = container_ul->id; st->codecpar->width = descriptor->width; st->codecpar->height = descriptor->height; /* Field height, not frame height */ switch (descriptor->frame_layout) { case FullFrame: st->codecpar->field_order = AV_FIELD_PROGRESSIVE; break; case OneField: /* Every other line is stored and needs to be duplicated. */ av_log(mxf->fc, AV_LOG_INFO, "OneField frame layout isn't currently supported\n"); break; /* The correct thing to do here is fall through, but by breaking we might be able to decode some streams at half the vertical resolution, rather than not al all. It's also for compatibility with the old behavior. */ case MixedFields: break; case SegmentedFrame: st->codecpar->field_order = AV_FIELD_PROGRESSIVE; case SeparateFields: av_log(mxf->fc, AV_LOG_DEBUG, "video_line_map: (%d, %d), field_dominance: %d\n", descriptor->video_line_map[0], descriptor->video_line_map[1], descriptor->field_dominance); if ((descriptor->video_line_map[0] > 0) && (descriptor->video_line_map[1] > 0)) { /* Detect coded field order from VideoLineMap: * (even, even) => bottom field coded first * (even, odd) => top field coded first * (odd, even) => top field coded first * (odd, odd) => bottom field coded first */ if ((descriptor->video_line_map[0] + descriptor->video_line_map[1]) % 2) { switch (descriptor->field_dominance) { case MXF_FIELD_DOMINANCE_DEFAULT: case MXF_FIELD_DOMINANCE_FF: st->codecpar->field_order = AV_FIELD_TT; break; case MXF_FIELD_DOMINANCE_FL: st->codecpar->field_order = AV_FIELD_TB; break; default: avpriv_request_sample(mxf->fc, "Field dominance %d support", descriptor->field_dominance); } } else { switch (descriptor->field_dominance) { case MXF_FIELD_DOMINANCE_DEFAULT: case MXF_FIELD_DOMINANCE_FF: st->codecpar->field_order = AV_FIELD_BB; break; case MXF_FIELD_DOMINANCE_FL: st->codecpar->field_order = AV_FIELD_BT; break; default: avpriv_request_sample(mxf->fc, "Field dominance %d support", descriptor->field_dominance); } } } /* Turn field height into frame height. */ st->codecpar->height *= 2; break; default: av_log(mxf->fc, AV_LOG_INFO, "Unknown frame layout type: %d\n", descriptor->frame_layout); } if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) { st->codecpar->format = descriptor->pix_fmt; if (st->codecpar->format == AV_PIX_FMT_NONE) { pix_fmt_ul = mxf_get_codec_ul(ff_mxf_pixel_format_uls, &descriptor->essence_codec_ul); st->codecpar->format = (enum AVPixelFormat)pix_fmt_ul->id; if (st->codecpar->format== AV_PIX_FMT_NONE) { st->codecpar->codec_tag = mxf_get_codec_ul(ff_mxf_codec_tag_uls, &descriptor->essence_codec_ul)->id; if (!st->codecpar->codec_tag) { /* support files created before RP224v10 by defaulting to UYVY422 if subsampling is 4:2:2 and component depth is 8-bit */ if (descriptor->horiz_subsampling == 2 && descriptor->vert_subsampling == 1 && descriptor->component_depth == 8) { st->codecpar->format = AV_PIX_FMT_UYVY422; } } } } } st->need_parsing = AVSTREAM_PARSE_HEADERS; if (material_track->sequence->origin) { av_dict_set_int(&st->metadata, "material_track_origin", material_track->sequence->origin, 0); } if (source_track->sequence->origin) { av_dict_set_int(&st->metadata, "source_track_origin", source_track->sequence->origin, 0); } if (descriptor->aspect_ratio.num && descriptor->aspect_ratio.den) st->display_aspect_ratio = descriptor->aspect_ratio; } else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { container_ul = mxf_get_codec_ul(mxf_sound_essence_container_uls, essence_container_ul); /* Only overwrite existing codec ID if it is unset or A-law, which is the default according to SMPTE RP 224. */ if (st->codecpar->codec_id == AV_CODEC_ID_NONE || (st->codecpar->codec_id == AV_CODEC_ID_PCM_ALAW && (enum AVCodecID)container_ul->id != AV_CODEC_ID_NONE)) st->codecpar->codec_id = (enum AVCodecID)container_ul->id; st->codecpar->channels = descriptor->channels; st->codecpar->bits_per_coded_sample = descriptor->bits_per_sample; if (descriptor->sample_rate.den > 0) { st->codecpar->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den; avpriv_set_pts_info(st, 64, descriptor->sample_rate.den, descriptor->sample_rate.num); } else { av_log(mxf->fc, AV_LOG_WARNING, "invalid sample rate (%d/%d) " "found for stream #%d, time base forced to 1/48000\n", descriptor->sample_rate.num, descriptor->sample_rate.den, st->index); avpriv_set_pts_info(st, 64, 1, 48000); } /* if duration is set, rescale it from EditRate to SampleRate */ if (st->duration != AV_NOPTS_VALUE) st->duration = av_rescale_q(st->duration, av_inv_q(material_track->edit_rate), st->time_base); /* TODO: implement AV_CODEC_ID_RAWAUDIO */ if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16LE) { if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24) st->codecpar->codec_id = AV_CODEC_ID_PCM_S24LE; else if (descriptor->bits_per_sample == 32) st->codecpar->codec_id = AV_CODEC_ID_PCM_S32LE; } else if (st->codecpar->codec_id == AV_CODEC_ID_PCM_S16BE) { if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24) st->codecpar->codec_id = AV_CODEC_ID_PCM_S24BE; else if (descriptor->bits_per_sample == 32) st->codecpar->codec_id = AV_CODEC_ID_PCM_S32BE; } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) { st->need_parsing = AVSTREAM_PARSE_FULL; } } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { enum AVMediaType type; container_ul = mxf_get_codec_ul(mxf_data_essence_container_uls, essence_container_ul); if (st->codecpar->codec_id == AV_CODEC_ID_NONE) st->codecpar->codec_id = container_ul->id; type = avcodec_get_type(st->codecpar->codec_id); if (type == AVMEDIA_TYPE_SUBTITLE) st->codecpar->codec_type = type; if (container_ul->desc) av_dict_set(&st->metadata, "data_type", container_ul->desc, 0); } if (descriptor->extradata) { if (!ff_alloc_extradata(st->codecpar, descriptor->extradata_size)) { memcpy(st->codecpar->extradata, descriptor->extradata, descriptor->extradata_size); } } else if (st->codecpar->codec_id == AV_CODEC_ID_H264) { int coded_width = mxf_get_codec_ul(mxf_intra_only_picture_coded_width, &descriptor->essence_codec_ul)->id; if (coded_width) st->codecpar->width = coded_width; ret = ff_generate_avci_extradata(st); if (ret < 0) return ret; } if (st->codecpar->codec_type != AVMEDIA_TYPE_DATA && source_track->wrapping != FrameWrapped) { /* TODO: decode timestamps */ st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS; } } ret = 0; fail_and_free: return ret; }
2752
True
1
CVE-2018-1999011
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/2b46ebdbff1d8dec7a3d8ea280a612b91a582869', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/2b46ebdbff1d8dec7a3d8ea280a612b91a582869', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/104896', 'name': '104896', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://seclists.org/bugtraq/2019/May/60', 'name': '20190523 [SECURITY] [DSA 4449-1] ffmpeg security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://www.debian.org/security/2019/dsa-4449', 'name': 'DSA-4449', 'refsource': 'DEBIAN', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-119'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '4.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'FFmpeg before commit 2b46ebdbff1d8dec7a3d8ea280a612b91a582869 contains a Buffer Overflow vulnerability in asf_o format demuxer that can result in heap-buffer-overflow that may result in remote code execution. This attack appears to be exploitable via specially crafted ASF file that has to be provided as input to FFmpeg. This vulnerability appears to have been fixed in 2b46ebdbff1d8dec7a3d8ea280a612b91a582869 and later.'}]
2019-05-23T11:29Z
2018-07-23T15:29Z
Improper Restriction of Operations within the Bounds of a Memory Buffer
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. 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.
https://cwe.mitre.org/data/definitions/119.html
0
Michael Niedermayer
2018-07-03 21:01:23+02:00
avformat/asfdec_o: Check size_bmp more fully Fixes: integer overflow and out of array access Fixes: asfo-crash-46080c4341572a7137a162331af77f6ded45cbd7 Found-by: Paul Ch <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
2b46ebdbff1d8dec7a3d8ea280a612b91a582869
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
parse_video_info
parse_video_info( AVIOContext * pb , AVStream * st)
['pb', 'st']
static int parse_video_info(AVIOContext *pb, AVStream *st) { uint16_t size_asf; // ASF-specific Format Data size uint32_t size_bmp; // BMP_HEADER-specific Format Data size unsigned int tag; st->codecpar->width = avio_rl32(pb); st->codecpar->height = avio_rl32(pb); avio_skip(pb, 1); // skip reserved flags size_asf = avio_rl16(pb); tag = ff_get_bmp_header(pb, st, &size_bmp); st->codecpar->codec_tag = tag; st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); size_bmp = FFMAX(size_asf, size_bmp); if (size_bmp > BMP_HEADER_SIZE) { int ret; st->codecpar->extradata_size = size_bmp - BMP_HEADER_SIZE; if (!(st->codecpar->extradata = av_malloc(st->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE))) { st->codecpar->extradata_size = 0; return AVERROR(ENOMEM); } memset(st->codecpar->extradata + st->codecpar->extradata_size , 0, AV_INPUT_BUFFER_PADDING_SIZE); if ((ret = avio_read(pb, st->codecpar->extradata, st->codecpar->extradata_size)) < 0) return ret; } return 0; }
209
True
1
CVE-2018-1999013
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:N/A:N
NETWORK
MEDIUM
NONE
PARTIAL
NONE
NONE
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
NONE
NONE
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/a7e032a277452366771951e29fd0bf2bd5c029f0', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/a7e032a277452366771951e29fd0bf2bd5c029f0', 'refsource': 'CONFIRM', 'tags': ['Issue Tracking', 'Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/104896', 'name': '104896', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}]
[{'description': [{'lang': 'en', 'value': 'CWE-416'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndIncluding': '4.0.1', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'FFmpeg before commit a7e032a277452366771951e29fd0bf2bd5c029f0 contains a use-after-free vulnerability in the realmedia demuxer that can result in vulnerability allows attacker to read heap memory. This attack appear to be exploitable via specially crafted RM file has to be provided as input. This vulnerability appears to have been fixed in a7e032a277452366771951e29fd0bf2bd5c029f0 and later.'}]
2018-09-20T16:21Z
2018-07-23T15:29Z
Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.
The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes: Error conditions and other exceptional circumstances. Confusion over which part of the program is responsible for freeing the memory. 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. 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.
https://cwe.mitre.org/data/definitions/416.html
0
Michael Niedermayer
2018-07-03 21:37:46+02:00
avformat/rmdec: Do not pass mime type in rm_read_multi() to ff_rm_read_mdpr_codecdata() Fixes: use after free() Fixes: rmdec-crash-ffe85b4cab1597d1cfea6955705e53f1f5c8a362 Found-by: Paul Ch <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
a7e032a277452366771951e29fd0bf2bd5c029f0
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
rm_read_multi
rm_read_multi( AVFormatContext * s , AVIOContext * pb , AVStream * st , char * mime)
['s', 'pb', 'st', 'mime']
static int rm_read_multi(AVFormatContext *s, AVIOContext *pb, AVStream *st, char *mime) { int number_of_streams = avio_rb16(pb); int number_of_mdpr; int i, ret; unsigned size2; for (i = 0; i<number_of_streams; i++) avio_rb16(pb); number_of_mdpr = avio_rb16(pb); if (number_of_mdpr != 1) { avpriv_request_sample(s, "MLTI with multiple (%d) MDPR", number_of_mdpr); } for (i = 0; i < number_of_mdpr; i++) { AVStream *st2; if (i > 0) { st2 = avformat_new_stream(s, NULL); if (!st2) { ret = AVERROR(ENOMEM); return ret; } st2->id = st->id + (i<<16); st2->codecpar->bit_rate = st->codecpar->bit_rate; st2->start_time = st->start_time; st2->duration = st->duration; st2->codecpar->codec_type = AVMEDIA_TYPE_DATA; st2->priv_data = ff_rm_alloc_rmstream(); if (!st2->priv_data) return AVERROR(ENOMEM); } else st2 = st; size2 = avio_rb32(pb); ret = ff_rm_read_mdpr_codecdata(s, s->pb, st2, st2->priv_data, size2, mime); if (ret < 0) return ret; } return 0; }
251
True
1
CVE-2018-1999010
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/cced03dd667a5df6df8fd40d8de0bff477ee02e8', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/cced03dd667a5df6df8fd40d8de0bff477ee02e8', 'refsource': 'CONFIRM', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/104896', 'name': '104896', 'refsource': 'BID', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/01/msg00006.html', 'name': '[debian-lts-announce] 20190107 [SECURITY] [DLA 1630-1] libav security update', 'refsource': 'MLIST', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-125'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.4.3', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'FFmpeg before commit cced03dd667a5df6df8fd40d8de0bff477ee02e8 contains multiple out of array access vulnerabilities in the mms protocol that can result in attackers accessing out of bound data. This attack appear to be exploitable via network connectivity. This vulnerability appears to have been fixed in cced03dd667a5df6df8fd40d8de0bff477ee02e8 and later.'}]
2019-03-27T19:11Z
2018-07-23T15:29Z
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/125.html
0
Michael Niedermayer
2018-07-03 20:33:04+02:00
avformat/mms: Add missing chunksize check Fixes: out of array read Fixes: mms-crash-01b6c5d85f9d9f40f4e879896103e9f5b222816a Found-by: Paul Ch <[email protected]> 1st hunk by Paul Ch <[email protected]> Tested-by: Paul Ch <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
cced03dd667a5df6df8fd40d8de0bff477ee02e8
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
ff_mms_asf_header_parser
ff_mms_asf_header_parser( MMSContext * mms)
['mms']
int ff_mms_asf_header_parser(MMSContext *mms) { uint8_t *p = mms->asf_header; uint8_t *end; int flags, stream_id; mms->stream_num = 0; if (mms->asf_header_size < sizeof(ff_asf_guid) * 2 + 22 || memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) { av_log(NULL, AV_LOG_ERROR, "Corrupt stream (invalid ASF header, size=%d)\n", mms->asf_header_size); return AVERROR_INVALIDDATA; } end = mms->asf_header + mms->asf_header_size; p += sizeof(ff_asf_guid) + 14; while(end - p >= sizeof(ff_asf_guid) + 8) { uint64_t chunksize; if (!memcmp(p, ff_asf_data_header, sizeof(ff_asf_guid))) { chunksize = 50; // see Reference [2] section 5.1 } else { chunksize = AV_RL64(p + sizeof(ff_asf_guid)); } if (!chunksize || chunksize > end - p) { av_log(NULL, AV_LOG_ERROR, "Corrupt stream (header chunksize %"PRId64" is invalid)\n", chunksize); return AVERROR_INVALIDDATA; } if (!memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) { /* read packet size */ if (end - p > sizeof(ff_asf_guid) * 2 + 68) { mms->asf_packet_len = AV_RL32(p + sizeof(ff_asf_guid) * 2 + 64); if (mms->asf_packet_len <= 0 || mms->asf_packet_len > sizeof(mms->in_buffer)) { av_log(NULL, AV_LOG_ERROR, "Corrupt stream (too large pkt_len %d)\n", mms->asf_packet_len); return AVERROR_INVALIDDATA; } } } else if (!memcmp(p, ff_asf_stream_header, sizeof(ff_asf_guid))) { flags = AV_RL16(p + sizeof(ff_asf_guid)*3 + 24); stream_id = flags & 0x7F; //The second condition is for checking CS_PKT_STREAM_ID_REQUEST packet size, //we can calculate the packet size by stream_num. //Please see function send_stream_selection_request(). if (mms->stream_num < MMS_MAX_STREAMS && 46 + mms->stream_num * 6 < sizeof(mms->out_buffer)) { mms->streams = av_fast_realloc(mms->streams, &mms->nb_streams_allocated, (mms->stream_num + 1) * sizeof(MMSStream)); if (!mms->streams) return AVERROR(ENOMEM); mms->streams[mms->stream_num].id = stream_id; mms->stream_num++; } else { av_log(NULL, AV_LOG_ERROR, "Corrupt stream (too many A/V streams)\n"); return AVERROR_INVALIDDATA; } } else if (!memcmp(p, ff_asf_ext_stream_header, sizeof(ff_asf_guid))) { if (end - p >= 88) { int stream_count = AV_RL16(p + 84), ext_len_count = AV_RL16(p + 86); uint64_t skip_bytes = 88; while (stream_count--) { if (end - p < skip_bytes + 4) { av_log(NULL, AV_LOG_ERROR, "Corrupt stream (next stream name length is not in the buffer)\n"); return AVERROR_INVALIDDATA; } skip_bytes += 4 + AV_RL16(p + skip_bytes + 2); } while (ext_len_count--) { if (end - p < skip_bytes + 22) { av_log(NULL, AV_LOG_ERROR, "Corrupt stream (next extension system info length is not in the buffer)\n"); return AVERROR_INVALIDDATA; } skip_bytes += 22 + AV_RL32(p + skip_bytes + 18); } if (end - p < skip_bytes) { av_log(NULL, AV_LOG_ERROR, "Corrupt stream (the last extension system info length is invalid)\n"); return AVERROR_INVALIDDATA; } if (chunksize - skip_bytes > 24) chunksize = skip_bytes; } } else if (!memcmp(p, ff_asf_head1_guid, sizeof(ff_asf_guid))) { chunksize = 46; // see references [2] section 3.4. This should be set 46. } p += chunksize; } return 0; }
610
True
1
CVE-2018-14395
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
nan
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/fa19fbcf712a6a6cc5a5cfdc3254a97b9bce6582', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/fa19fbcf712a6a6cc5a5cfdc3254a97b9bce6582', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://www.debian.org/security/2018/dsa-4258', 'name': 'DSA-4258', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'http://www.securitytracker.com/id/1041394', 'name': '1041394', 'refsource': 'SECTRACK', 'tags': ['Third Party Advisory', 'VDB Entry']}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/2c0e98a0b478284bdff6d7a4062522605a8beae5', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/2c0e98a0b478284bdff6d7a4062522605a8beae5', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-369'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:3.2:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libavformat/movenc.c in FFmpeg 3.2 and 4.0.2 allows attackers to cause a denial of service (application crash caused by a divide-by-zero error) with a user crafted audio file when converting to the MOV audio format.'}]
2021-02-05T21:57Z
2018-07-19T05:29Z
Divide By Zero
The product divides a value by zero.
This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.
https://cwe.mitre.org/data/definitions/369.html
0
Michael Niedermayer
2018-07-08 00:16:42+02:00
avformat/movenc: Write version 2 of audio atom if channels is not known The version 1 needs the channel count and would divide by 0 Fixes: division by 0 Fixes: fpe_movenc.c_1108_1.ogg Fixes: fpe_movenc.c_1108_2.ogg Fixes: fpe_movenc.c_1108_3.wav Found-by: #CHEN HONGXU# <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
fa19fbcf712a6a6cc5a5cfdc3254a97b9bce6582
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
mov_write_audio_tag
mov_write_audio_tag( AVFormatContext * s , AVIOContext * pb , MOVMuxContext * mov , MOVTrack * track)
['s', 'pb', 'mov', 'track']
static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); int version = 0; uint32_t tag = track->tag; if (track->mode == MODE_MOV) { if (track->timescale > UINT16_MAX) { if (mov_get_lpcm_flags(track->par->codec_id)) tag = AV_RL32("lpcm"); version = 2; } else if (track->audio_vbr || mov_pcm_le_gt16(track->par->codec_id) || mov_pcm_be_gt16(track->par->codec_id) || track->par->codec_id == AV_CODEC_ID_ADPCM_MS || track->par->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV || track->par->codec_id == AV_CODEC_ID_QDM2) { version = 1; } } avio_wb32(pb, 0); /* size */ if (mov->encryption_scheme != MOV_ENC_NONE) { ffio_wfourcc(pb, "enca"); } else { avio_wl32(pb, tag); // store it byteswapped } avio_wb32(pb, 0); /* Reserved */ avio_wb16(pb, 0); /* Reserved */ avio_wb16(pb, 1); /* Data-reference index, XXX == 1 */ /* SoundDescription */ avio_wb16(pb, version); /* Version */ avio_wb16(pb, 0); /* Revision level */ avio_wb32(pb, 0); /* Reserved */ if (version == 2) { avio_wb16(pb, 3); avio_wb16(pb, 16); avio_wb16(pb, 0xfffe); avio_wb16(pb, 0); avio_wb32(pb, 0x00010000); avio_wb32(pb, 72); avio_wb64(pb, av_double2int(track->par->sample_rate)); avio_wb32(pb, track->par->channels); avio_wb32(pb, 0x7F000000); avio_wb32(pb, av_get_bits_per_sample(track->par->codec_id)); avio_wb32(pb, mov_get_lpcm_flags(track->par->codec_id)); avio_wb32(pb, track->sample_size); avio_wb32(pb, get_samples_per_packet(track)); } else { if (track->mode == MODE_MOV) { avio_wb16(pb, track->par->channels); if (track->par->codec_id == AV_CODEC_ID_PCM_U8 || track->par->codec_id == AV_CODEC_ID_PCM_S8) avio_wb16(pb, 8); /* bits per sample */ else if (track->par->codec_id == AV_CODEC_ID_ADPCM_G726) avio_wb16(pb, track->par->bits_per_coded_sample); else avio_wb16(pb, 16); avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */ } else { /* reserved for mp4/3gp */ if (track->par->codec_id == AV_CODEC_ID_FLAC || track->par->codec_id == AV_CODEC_ID_OPUS) { avio_wb16(pb, track->par->channels); } else { avio_wb16(pb, 2); } if (track->par->codec_id == AV_CODEC_ID_FLAC) { avio_wb16(pb, track->par->bits_per_raw_sample); } else { avio_wb16(pb, 16); } avio_wb16(pb, 0); } avio_wb16(pb, 0); /* packet size (= 0) */ if (track->par->codec_id == AV_CODEC_ID_OPUS) avio_wb16(pb, 48000); else avio_wb16(pb, track->par->sample_rate <= UINT16_MAX ? track->par->sample_rate : 0); avio_wb16(pb, 0); /* Reserved */ } if (version == 1) { /* SoundDescription V1 extended info */ if (mov_pcm_le_gt16(track->par->codec_id) || mov_pcm_be_gt16(track->par->codec_id)) avio_wb32(pb, 1); /* must be 1 for uncompressed formats */ else avio_wb32(pb, track->par->frame_size); /* Samples per packet */ avio_wb32(pb, track->sample_size / track->par->channels); /* Bytes per packet */ avio_wb32(pb, track->sample_size); /* Bytes per frame */ avio_wb32(pb, 2); /* Bytes per sample */ } if (track->mode == MODE_MOV && (track->par->codec_id == AV_CODEC_ID_AAC || track->par->codec_id == AV_CODEC_ID_AC3 || track->par->codec_id == AV_CODEC_ID_EAC3 || track->par->codec_id == AV_CODEC_ID_AMR_NB || track->par->codec_id == AV_CODEC_ID_ALAC || track->par->codec_id == AV_CODEC_ID_ADPCM_MS || track->par->codec_id == AV_CODEC_ID_ADPCM_IMA_WAV || track->par->codec_id == AV_CODEC_ID_QDM2 || (mov_pcm_le_gt16(track->par->codec_id) && version==1) || (mov_pcm_be_gt16(track->par->codec_id) && version==1))) mov_write_wave_tag(s, pb, track); else if (track->tag == MKTAG('m','p','4','a')) mov_write_esds_tag(pb, track); else if (track->par->codec_id == AV_CODEC_ID_AMR_NB) mov_write_amr_tag(pb, track); else if (track->par->codec_id == AV_CODEC_ID_AC3) mov_write_ac3_tag(pb, track); else if (track->par->codec_id == AV_CODEC_ID_EAC3) mov_write_eac3_tag(pb, track); else if (track->par->codec_id == AV_CODEC_ID_ALAC) mov_write_extradata_tag(pb, track); else if (track->par->codec_id == AV_CODEC_ID_WMAPRO) mov_write_wfex_tag(s, pb, track); else if (track->par->codec_id == AV_CODEC_ID_FLAC) mov_write_dfla_tag(pb, track); else if (track->par->codec_id == AV_CODEC_ID_OPUS) mov_write_dops_tag(pb, track); else if (track->vos_len > 0) mov_write_glbl_tag(pb, track); if (track->mode == MODE_MOV && track->par->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_chan_tag(s, pb, track); if (mov->encryption_scheme != MOV_ENC_NONE) { ff_mov_cenc_write_sinf_tag(track, pb, mov->encryption_kid); } return update_size(pb, pos); }
986
True
1
CVE-2019-1000016
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/b97a4b658814b2de8b9f2a3bce491c002d34de31#diff-cd7e24986650014d67f484f3ffceef3f', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/b97a4b658814b2de8b9f2a3bce491c002d34de31#diff-cd7e24986650014d67f484f3ffceef3f', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-129'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.1:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'FFMPEG version 4.1 contains a CWE-129: Improper Validation of Array Index vulnerability in libavcodec/cbs_av1.c that can result in Denial of service. This attack appears to be exploitable via specially crafted AV1 file has to be provided as input. This vulnerability appears to have been fixed in after commit b97a4b658814b2de8b9f2a3bce491c002d34de31.'}]
2019-02-06T17:00Z
2019-02-04T21:29Z
Improper Validation of Array Index
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.
https://cwe.mitre.org/data/definitions/129.html
0
Mark Thompson
2018-12-02 20:49:24+00:00
cbs_av1: Fix reading of overlong uvlc codes The specification allows 2^32-1 to be encoded as any number of zeroes greater than 31, followed by a one. This previously failed because the trace code would overflow the array containing the string representation of the bits if there were more than 63 zeroes. Fix that by splitting the trace output into batches, and at the same time move it out of the default path. (While this seems likely to be a specification error, libaom does support it so we probably should as well.) From a test case by keval shah <[email protected]>. Reviewed-by: Michael Niedermayer <[email protected]>
b97a4b658814b2de8b9f2a3bce491c002d34de31
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
cbs_av1_read_uvlc
cbs_av1_read_uvlc( CodedBitstreamContext * ctx , GetBitContext * gbc , const char * name , uint32_t * write_to , uint32_t range_min , uint32_t range_max)
['ctx', 'gbc', 'name', 'write_to', 'range_min', 'range_max']
static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint32_t *write_to, uint32_t range_min, uint32_t range_max) { uint32_t value; int position, zeroes, i, j; char bits[65]; if (ctx->trace_enable) position = get_bits_count(gbc); zeroes = i = 0; while (1) { if (get_bits_left(gbc) < zeroes + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid uvlc code at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } if (get_bits1(gbc)) { bits[i++] = '1'; break; } else { bits[i++] = '0'; ++zeroes; } } if (zeroes >= 32) { value = MAX_UINT_BITS(32); } else { value = get_bits_long(gbc, zeroes); for (j = 0; j < zeroes; j++) bits[i++] = (value >> (zeroes - j - 1) & 1) ? '1' : '0'; value += (1 << zeroes) - 1; } if (ctx->trace_enable) { bits[i] = 0; ff_cbs_trace_syntax_element(ctx, position, name, NULL, bits, value); } if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRIu32", but must be in [%"PRIu32",%"PRIu32"].\n", name, value, range_min, range_max); return AVERROR_INVALIDDATA; } *write_to = value; return 0; }
288
True
1
CVE-2019-11338
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/54655623a82632e7624714d7b2a3e039dc5faa7e', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/54655623a82632e7624714d7b2a3e039dc5faa7e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'http://www.securityfocus.com/bid/108034', 'name': '108034', 'refsource': 'BID', 'tags': []}, {'url': 'https://usn.ubuntu.com/3967-1/', 'name': 'USN-3967-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://seclists.org/bugtraq/2019/May/60', 'name': '20190523 [SECURITY] [DSA 4449-1] ffmpeg security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://www.debian.org/security/2019/dsa-4449', 'name': 'DSA-4449', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/05/msg00043.html', 'name': '[debian-lts-announce] 20190529 [SECURITY] [DLA 1809-1] libav security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'http://lists.opensuse.org/opensuse-security-announce/2020-01/msg00012.html', 'name': 'openSUSE-SU-2020:0024', 'refsource': 'SUSE', 'tags': []}, {'url': 'https://usn.ubuntu.com/4431-1/', 'name': 'USN-4431-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/9ccc633068c6fe76989f487c8932bd11886ad65b', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/9ccc633068c6fe76989f487c8932bd11886ad65b', 'refsource': 'MISC', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.1.2:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'libavcodec/hevcdec.c in FFmpeg 3.4 and 4.1.2 mishandles detection of duplicate first slices, which allows remote attackers to cause a denial of service (NULL pointer dereference and out-of-array access) or possibly have unspecified other impact via crafted HEVC data.'}]
2021-01-04T19:15Z
2019-04-19T00:29Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Michael Niedermayer
2019-03-23 20:55:08+01:00
avcodec/hevcdec: Avoid only partly skiping duplicate first slices Fixes: NULL pointer dereference and out of array access Fixes: 13871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5746167087890432 Fixes: 13845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5650370728034304 This also fixes the return code for explode mode Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: James Almer <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
54655623a82632e7624714d7b2a3e039dc5faa7e
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
decode_nal_unit
decode_nal_unit( HEVCContext * s , const H2645NAL * nal)
['s', 'nal']
static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) { HEVCLocalContext *lc = s->HEVClc; GetBitContext *gb = &lc->gb; int ctb_addr_ts, ret; *gb = nal->gb; s->nal_unit_type = nal->type; s->temporal_id = nal->temporal_id; switch (s->nal_unit_type) { case HEVC_NAL_VPS: if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { ret = s->avctx->hwaccel->decode_params(s->avctx, nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } ret = ff_hevc_decode_nal_vps(gb, s->avctx, &s->ps); if (ret < 0) goto fail; break; case HEVC_NAL_SPS: if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { ret = s->avctx->hwaccel->decode_params(s->avctx, nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } ret = ff_hevc_decode_nal_sps(gb, s->avctx, &s->ps, s->apply_defdispwin); if (ret < 0) goto fail; break; case HEVC_NAL_PPS: if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { ret = s->avctx->hwaccel->decode_params(s->avctx, nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } ret = ff_hevc_decode_nal_pps(gb, s->avctx, &s->ps); if (ret < 0) goto fail; break; case HEVC_NAL_SEI_PREFIX: case HEVC_NAL_SEI_SUFFIX: if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { ret = s->avctx->hwaccel->decode_params(s->avctx, nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } ret = ff_hevc_decode_nal_sei(gb, s->avctx, &s->sei, &s->ps, s->nal_unit_type); if (ret < 0) goto fail; break; case HEVC_NAL_TRAIL_R: case HEVC_NAL_TRAIL_N: case HEVC_NAL_TSA_N: case HEVC_NAL_TSA_R: case HEVC_NAL_STSA_N: case HEVC_NAL_STSA_R: case HEVC_NAL_BLA_W_LP: case HEVC_NAL_BLA_W_RADL: case HEVC_NAL_BLA_N_LP: case HEVC_NAL_IDR_W_RADL: case HEVC_NAL_IDR_N_LP: case HEVC_NAL_CRA_NUT: case HEVC_NAL_RADL_N: case HEVC_NAL_RADL_R: case HEVC_NAL_RASL_N: case HEVC_NAL_RASL_R: ret = hls_slice_header(s); if (ret < 0) return ret; if ( (s->avctx->skip_frame >= AVDISCARD_BIDIR && s->sh.slice_type == HEVC_SLICE_B) || (s->avctx->skip_frame >= AVDISCARD_NONINTRA && s->sh.slice_type != HEVC_SLICE_I) || (s->avctx->skip_frame >= AVDISCARD_NONKEY && !IS_IRAP(s))) { break; } if (s->sh.first_slice_in_pic_flag) { if (s->ref) { av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n"); goto fail; } if (s->max_ra == INT_MAX) { if (s->nal_unit_type == HEVC_NAL_CRA_NUT || IS_BLA(s)) { s->max_ra = s->poc; } else { if (IS_IDR(s)) s->max_ra = INT_MIN; } } if ((s->nal_unit_type == HEVC_NAL_RASL_R || s->nal_unit_type == HEVC_NAL_RASL_N) && s->poc <= s->max_ra) { s->is_decoded = 0; break; } else { if (s->nal_unit_type == HEVC_NAL_RASL_R && s->poc > s->max_ra) s->max_ra = INT_MIN; } s->overlap ++; ret = hevc_frame_start(s); if (ret < 0) return ret; } else if (!s->ref) { av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n"); goto fail; } if (s->nal_unit_type != s->first_nal_type) { av_log(s->avctx, AV_LOG_ERROR, "Non-matching NAL types of the VCL NALUs: %d %d\n", s->first_nal_type, s->nal_unit_type); return AVERROR_INVALIDDATA; } if (!s->sh.dependent_slice_segment_flag && s->sh.slice_type != HEVC_SLICE_I) { ret = ff_hevc_slice_rpl(s); if (ret < 0) { av_log(s->avctx, AV_LOG_WARNING, "Error constructing the reference lists for the current slice.\n"); goto fail; } } if (s->sh.first_slice_in_pic_flag && s->avctx->hwaccel) { ret = s->avctx->hwaccel->start_frame(s->avctx, NULL, 0); if (ret < 0) goto fail; } if (s->avctx->hwaccel) { ret = s->avctx->hwaccel->decode_slice(s->avctx, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } else { if (s->threads_number > 1 && s->sh.num_entry_point_offsets > 0) ctb_addr_ts = hls_slice_data_wpp(s, nal); else ctb_addr_ts = hls_slice_data(s); if (ctb_addr_ts >= (s->ps.sps->ctb_width * s->ps.sps->ctb_height)) { s->is_decoded = 1; } if (ctb_addr_ts < 0) { ret = ctb_addr_ts; goto fail; } } break; case HEVC_NAL_EOS_NUT: case HEVC_NAL_EOB_NUT: s->seq_decode = (s->seq_decode + 1) & 0xff; s->max_ra = INT_MAX; break; case HEVC_NAL_AUD: case HEVC_NAL_FD_NUT: break; default: av_log(s->avctx, AV_LOG_INFO, "Skipping NAL unit %d\n", s->nal_unit_type); } return 0; fail: if (s->avctx->err_recognition & AV_EF_EXPLODE) return ret; return 0; }
1050
True
1
CVE-2019-12730
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/compare/a97ea53...ba11e40', 'name': 'https://github.com/FFmpeg/FFmpeg/compare/a97ea53...ba11e40', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/ed188f6dcdf0935c939ed813cf8745d50742014b', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/ed188f6dcdf0935c939ed813cf8745d50742014b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/9b4004c054964a49c7ba44583f4cee22486dd8f2', 'name': 'https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/9b4004c054964a49c7ba44583f4cee22486dd8f2', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n4.1.4', 'name': 'https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n4.1.4', 'refsource': 'CONFIRM', 'tags': []}, {'url': 'http://www.securityfocus.com/bid/109317', 'name': '109317', 'refsource': 'BID', 'tags': []}, {'url': 'https://seclists.org/bugtraq/2019/Aug/30', 'name': '20190816 [SECURITY] [DSA 4502-1] ffmpeg security update', 'refsource': 'BUGTRAQ', 'tags': []}, {'url': 'https://www.debian.org/security/2019/dsa-4502', 'name': 'DSA-4502', 'refsource': 'DEBIAN', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202003-65', 'name': 'GLSA-202003-65', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://usn.ubuntu.com/4431-1/', 'name': 'USN-4431-1', 'refsource': 'UBUNTU', 'tags': []}]
[{'description': [{'lang': 'en', 'value': 'CWE-908'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.2.14', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'aa_read_header in libavformat/aadec.c in FFmpeg before 3.2.14 and 4.x before 4.1.4 does not check for sscanf failure and consequently allows use of uninitialized variables.'}]
2020-08-24T17:37Z
2019-06-04T14:29Z
Use of Uninitialized Resource
The software uses or accesses a resource that has not been initialized.
When a resource has not been properly initialized, the software may behave unexpectedly. This may lead to a crash or invalid memory access, but the consequences vary depending on the type of resource and how it is used within the software.
https://cwe.mitre.org/data/definitions/908.html
0
Michael Niedermayer
2019-04-16 23:56:43+02:00
avformat/aadec: Check for scanf() failure Fixes: use of uninitialized variables Fixes: blank.aa Found-by: Chamal De Silva <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
ed188f6dcdf0935c939ed813cf8745d50742014b
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
aa_read_header
aa_read_header( AVFormatContext * s)
['s']
static int aa_read_header(AVFormatContext *s) { int i, j, idx, largest_idx = -1; uint32_t nkey, nval, toc_size, npairs, header_seed = 0, start; char key[128], val[128], codec_name[64] = {0}; uint8_t output[24], dst[8], src[8]; int64_t largest_size = -1, current_size = -1, chapter_pos; struct toc_entry { uint32_t offset; uint32_t size; } TOC[MAX_TOC_ENTRIES]; uint32_t header_key_part[4]; uint8_t header_key[16] = {0}; AADemuxContext *c = s->priv_data; AVIOContext *pb = s->pb; AVStream *st; /* parse .aa header */ avio_skip(pb, 4); // file size avio_skip(pb, 4); // magic string toc_size = avio_rb32(pb); // TOC size avio_skip(pb, 4); // unidentified integer if (toc_size > MAX_TOC_ENTRIES) return AVERROR_INVALIDDATA; for (i = 0; i < toc_size; i++) { // read TOC avio_skip(pb, 4); // TOC entry index TOC[i].offset = avio_rb32(pb); // block offset TOC[i].size = avio_rb32(pb); // block size } avio_skip(pb, 24); // header termination block (ignored) npairs = avio_rb32(pb); // read dictionary entries if (npairs > MAX_DICTIONARY_ENTRIES) return AVERROR_INVALIDDATA; for (i = 0; i < npairs; i++) { memset(val, 0, sizeof(val)); memset(key, 0, sizeof(key)); avio_skip(pb, 1); // unidentified integer nkey = avio_rb32(pb); // key string length nval = avio_rb32(pb); // value string length avio_get_str(pb, nkey, key, sizeof(key)); avio_get_str(pb, nval, val, sizeof(val)); if (!strcmp(key, "codec")) { av_log(s, AV_LOG_DEBUG, "Codec is <%s>\n", val); strncpy(codec_name, val, sizeof(codec_name) - 1); } else if (!strcmp(key, "HeaderSeed")) { av_log(s, AV_LOG_DEBUG, "HeaderSeed is <%s>\n", val); header_seed = atoi(val); } else if (!strcmp(key, "HeaderKey")) { // this looks like "1234567890 1234567890 1234567890 1234567890" av_log(s, AV_LOG_DEBUG, "HeaderKey is <%s>\n", val); sscanf(val, "%"SCNu32"%"SCNu32"%"SCNu32"%"SCNu32, &header_key_part[0], &header_key_part[1], &header_key_part[2], &header_key_part[3]); for (idx = 0; idx < 4; idx++) { AV_WB32(&header_key[idx * 4], header_key_part[idx]); // convert each part to BE! } av_log(s, AV_LOG_DEBUG, "Processed HeaderKey is "); for (i = 0; i < 16; i++) av_log(s, AV_LOG_DEBUG, "%02x", header_key[i]); av_log(s, AV_LOG_DEBUG, "\n"); } else { av_dict_set(&s->metadata, key, val, 0); } } /* verify fixed key */ if (c->aa_fixed_key_len != 16) { av_log(s, AV_LOG_ERROR, "aa_fixed_key value needs to be 16 bytes!\n"); return AVERROR(EINVAL); } /* verify codec */ if ((c->codec_second_size = get_second_size(codec_name)) == -1) { av_log(s, AV_LOG_ERROR, "unknown codec <%s>!\n", codec_name); return AVERROR(EINVAL); } /* decryption key derivation */ c->tea_ctx = av_tea_alloc(); if (!c->tea_ctx) return AVERROR(ENOMEM); av_tea_init(c->tea_ctx, c->aa_fixed_key, 16); output[0] = output[1] = 0; // purely for padding purposes memcpy(output + 2, header_key, 16); idx = 0; for (i = 0; i < 3; i++) { // TEA CBC with weird mixed endianness AV_WB32(src, header_seed); AV_WB32(src + 4, header_seed + 1); header_seed += 2; av_tea_crypt(c->tea_ctx, dst, src, 1, NULL, 0); // TEA ECB encrypt for (j = 0; j < TEA_BLOCK_SIZE && idx < 18; j+=1, idx+=1) { output[idx] = output[idx] ^ dst[j]; } } memcpy(c->file_key, output + 2, 16); // skip first 2 bytes of output av_log(s, AV_LOG_DEBUG, "File key is "); for (i = 0; i < 16; i++) av_log(s, AV_LOG_DEBUG, "%02x", c->file_key[i]); av_log(s, AV_LOG_DEBUG, "\n"); /* decoder setup */ st = avformat_new_stream(s, NULL); if (!st) { av_freep(&c->tea_ctx); return AVERROR(ENOMEM); } st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; if (!strcmp(codec_name, "mp332")) { st->codecpar->codec_id = AV_CODEC_ID_MP3; st->codecpar->sample_rate = 22050; st->need_parsing = AVSTREAM_PARSE_FULL_RAW; avpriv_set_pts_info(st, 64, 8, 32000 * TIMEPREC); // encoded audio frame is MP3_FRAME_SIZE bytes (+1 with padding, unlikely) } else if (!strcmp(codec_name, "acelp85")) { st->codecpar->codec_id = AV_CODEC_ID_SIPR; st->codecpar->block_align = 19; st->codecpar->channels = 1; st->codecpar->sample_rate = 8500; st->codecpar->bit_rate = 8500; st->need_parsing = AVSTREAM_PARSE_FULL_RAW; avpriv_set_pts_info(st, 64, 8, 8500 * TIMEPREC); } else if (!strcmp(codec_name, "acelp16")) { st->codecpar->codec_id = AV_CODEC_ID_SIPR; st->codecpar->block_align = 20; st->codecpar->channels = 1; st->codecpar->sample_rate = 16000; st->codecpar->bit_rate = 16000; st->need_parsing = AVSTREAM_PARSE_FULL_RAW; avpriv_set_pts_info(st, 64, 8, 16000 * TIMEPREC); } /* determine, and jump to audio start offset */ for (i = 1; i < toc_size; i++) { // skip the first entry! current_size = TOC[i].size; if (current_size > largest_size) { largest_idx = i; largest_size = current_size; } } start = TOC[largest_idx].offset; avio_seek(pb, start, SEEK_SET); // extract chapter positions. since all formats have constant bit rate, use it // as time base in bytes/s, for easy stream position <-> timestamp conversion st->start_time = 0; c->content_start = start; c->content_end = start + largest_size; while ((chapter_pos = avio_tell(pb)) >= 0 && chapter_pos < c->content_end) { int chapter_idx = s->nb_chapters; uint32_t chapter_size = avio_rb32(pb); if (chapter_size == 0) break; chapter_pos -= start + CHAPTER_HEADER_SIZE * chapter_idx; avio_skip(pb, 4 + chapter_size); if (!avpriv_new_chapter(s, chapter_idx, st->time_base, chapter_pos * TIMEPREC, (chapter_pos + chapter_size) * TIMEPREC, NULL)) return AVERROR(ENOMEM); } st->duration = (largest_size - CHAPTER_HEADER_SIZE * s->nb_chapters) * TIMEPREC; ff_update_cur_dts(s, st, 0); avio_seek(pb, start, SEEK_SET); c->current_chapter_size = 0; c->seek_offset = 0; return 0; }
1277
True
1
CVE-2019-17539
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15733', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15733', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/8df6884832ec413cf032dfaa45c23b1c7876670c', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/8df6884832ec413cf032dfaa45c23b1c7876670c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202003-65', 'name': 'GLSA-202003-65', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4722', 'name': 'DSA-4722', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4431-1/', 'name': 'USN-4431-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/01/msg00026.html', 'name': '[debian-lts-announce] 20210131 [SECURITY] [DLA 2537-1] ffmpeg security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-476'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.0', 'versionEndExcluding': '4.0.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.1', 'versionEndExcluding': '4.1.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndExcluding': '3.4.7', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:esm:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'In FFmpeg before 4.2, avcodec_open2 in libavcodec/utils.c allows a NULL pointer dereference and possibly unspecified other impact when there is no valid close function pointer.'}]
2021-06-10T13:58Z
2019-10-14T02:15Z
NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.
NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.
https://cwe.mitre.org/data/definitions/476.html
0
Michael Niedermayer
2019-07-21 00:08:55+02:00
avcodec/utils: Check close before calling it Fixes: NULL pointer dereference Fixes: 15733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IDF_fuzzer-5658616977162240 Reviewed-by: Paul B Mahol <[email protected]> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
8df6884832ec413cf032dfaa45c23b1c7876670c
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
avcodec_open2
avcodec_open2( AVCodecContext * avctx , const AVCodec * codec , AVDictionary ** options)
['avctx', 'codec', 'options']
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) { int ret = 0; int codec_init_ok = 0; AVDictionary *tmp = NULL; const AVPixFmtDescriptor *pixdesc; if (avcodec_is_open(avctx)) return 0; if ((!codec && !avctx->codec)) { av_log(avctx, AV_LOG_ERROR, "No codec provided to avcodec_open2()\n"); return AVERROR(EINVAL); } if ((codec && avctx->codec && codec != avctx->codec)) { av_log(avctx, AV_LOG_ERROR, "This AVCodecContext was allocated for %s, " "but %s passed to avcodec_open2()\n", avctx->codec->name, codec->name); return AVERROR(EINVAL); } if (!codec) codec = avctx->codec; if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE) return AVERROR(EINVAL); if (options) av_dict_copy(&tmp, *options, 0); ff_lock_avcodec(avctx, codec); avctx->internal = av_mallocz(sizeof(*avctx->internal)); if (!avctx->internal) { ret = AVERROR(ENOMEM); goto end; } avctx->internal->pool = av_mallocz(sizeof(*avctx->internal->pool)); if (!avctx->internal->pool) { ret = AVERROR(ENOMEM); goto free_and_end; } avctx->internal->to_free = av_frame_alloc(); if (!avctx->internal->to_free) { ret = AVERROR(ENOMEM); goto free_and_end; } avctx->internal->compat_decode_frame = av_frame_alloc(); if (!avctx->internal->compat_decode_frame) { ret = AVERROR(ENOMEM); goto free_and_end; } avctx->internal->buffer_frame = av_frame_alloc(); if (!avctx->internal->buffer_frame) { ret = AVERROR(ENOMEM); goto free_and_end; } avctx->internal->buffer_pkt = av_packet_alloc(); if (!avctx->internal->buffer_pkt) { ret = AVERROR(ENOMEM); goto free_and_end; } avctx->internal->ds.in_pkt = av_packet_alloc(); if (!avctx->internal->ds.in_pkt) { ret = AVERROR(ENOMEM); goto free_and_end; } avctx->internal->last_pkt_props = av_packet_alloc(); if (!avctx->internal->last_pkt_props) { ret = AVERROR(ENOMEM); goto free_and_end; } avctx->internal->skip_samples_multiplier = 1; if (codec->priv_data_size > 0) { if (!avctx->priv_data) { avctx->priv_data = av_mallocz(codec->priv_data_size); if (!avctx->priv_data) { ret = AVERROR(ENOMEM); goto end; } if (codec->priv_class) { *(const AVClass **)avctx->priv_data = codec->priv_class; av_opt_set_defaults(avctx->priv_data); } } if (codec->priv_class && (ret = av_opt_set_dict(avctx->priv_data, &tmp)) < 0) goto free_and_end; } else { avctx->priv_data = NULL; } if ((ret = av_opt_set_dict(avctx, &tmp)) < 0) goto free_and_end; if (avctx->codec_whitelist && av_match_list(codec->name, avctx->codec_whitelist, ',') <= 0) { av_log(avctx, AV_LOG_ERROR, "Codec (%s) not on whitelist \'%s\'\n", codec->name, avctx->codec_whitelist); ret = AVERROR(EINVAL); goto free_and_end; } // only call ff_set_dimensions() for non H.264/VP6F/DXV codecs so as not to overwrite previously setup dimensions if (!(avctx->coded_width && avctx->coded_height && avctx->width && avctx->height && (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_VP6F || avctx->codec_id == AV_CODEC_ID_DXV))) { if (avctx->coded_width && avctx->coded_height) ret = ff_set_dimensions(avctx, avctx->coded_width, avctx->coded_height); else if (avctx->width && avctx->height) ret = ff_set_dimensions(avctx, avctx->width, avctx->height); if (ret < 0) goto free_and_end; } if ((avctx->coded_width || avctx->coded_height || avctx->width || avctx->height) && ( av_image_check_size2(avctx->coded_width, avctx->coded_height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0 || av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0)) { av_log(avctx, AV_LOG_WARNING, "Ignoring invalid width/height values\n"); ff_set_dimensions(avctx, 0, 0); } if (avctx->width > 0 && avctx->height > 0) { if (av_image_check_sar(avctx->width, avctx->height, avctx->sample_aspect_ratio) < 0) { av_log(avctx, AV_LOG_WARNING, "ignoring invalid SAR: %u/%u\n", avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den); avctx->sample_aspect_ratio = (AVRational){ 0, 1 }; } } /* if the decoder init function was already called previously, * free the already allocated subtitle_header before overwriting it */ if (av_codec_is_decoder(codec)) av_freep(&avctx->subtitle_header); if (avctx->channels > FF_SANE_NB_CHANNELS) { av_log(avctx, AV_LOG_ERROR, "Too many channels: %d\n", avctx->channels); ret = AVERROR(EINVAL); goto free_and_end; } avctx->codec = codec; if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) && avctx->codec_id == AV_CODEC_ID_NONE) { avctx->codec_type = codec->type; avctx->codec_id = codec->id; } if (avctx->codec_id != codec->id || (avctx->codec_type != codec->type && avctx->codec_type != AVMEDIA_TYPE_ATTACHMENT)) { av_log(avctx, AV_LOG_ERROR, "Codec type or id mismatches\n"); ret = AVERROR(EINVAL); goto free_and_end; } avctx->frame_number = 0; avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id); if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { const char *codec_string = av_codec_is_encoder(codec) ? "encoder" : "decoder"; AVCodec *codec2; av_log(avctx, AV_LOG_ERROR, "The %s '%s' is experimental but experimental codecs are not enabled, " "add '-strict %d' if you want to use it.\n", codec_string, codec->name, FF_COMPLIANCE_EXPERIMENTAL); codec2 = av_codec_is_encoder(codec) ? avcodec_find_encoder(codec->id) : avcodec_find_decoder(codec->id); if (!(codec2->capabilities & AV_CODEC_CAP_EXPERIMENTAL)) av_log(avctx, AV_LOG_ERROR, "Alternatively use the non experimental %s '%s'.\n", codec_string, codec2->name); ret = AVERROR_EXPERIMENTAL; goto free_and_end; } if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && (!avctx->time_base.num || !avctx->time_base.den)) { avctx->time_base.num = 1; avctx->time_base.den = avctx->sample_rate; } if (!HAVE_THREADS) av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n"); if (CONFIG_FRAME_THREAD_ENCODER && av_codec_is_encoder(avctx->codec)) { ff_unlock_avcodec(codec); //we will instantiate a few encoders thus kick the counter to prevent false detection of a problem ret = ff_frame_thread_encoder_init(avctx, options ? *options : NULL); ff_lock_avcodec(avctx, codec); if (ret < 0) goto free_and_end; } if (av_codec_is_decoder(avctx->codec)) { ret = ff_decode_bsfs_init(avctx); if (ret < 0) goto free_and_end; } if (HAVE_THREADS && !(avctx->internal->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) { ret = ff_thread_init(avctx); if (ret < 0) { goto free_and_end; } } if (!HAVE_THREADS && !(codec->capabilities & AV_CODEC_CAP_AUTO_THREADS)) avctx->thread_count = 1; if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) { av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n", avctx->codec->max_lowres); avctx->lowres = avctx->codec->max_lowres; } if (av_codec_is_encoder(avctx->codec)) { int i; #if FF_API_CODED_FRAME FF_DISABLE_DEPRECATION_WARNINGS avctx->coded_frame = av_frame_alloc(); if (!avctx->coded_frame) { ret = AVERROR(ENOMEM); goto free_and_end; } FF_ENABLE_DEPRECATION_WARNINGS #endif if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) { av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n"); ret = AVERROR(EINVAL); goto free_and_end; } if (avctx->codec->sample_fmts) { for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { if (avctx->sample_fmt == avctx->codec->sample_fmts[i]) break; if (avctx->channels == 1 && av_get_planar_sample_fmt(avctx->sample_fmt) == av_get_planar_sample_fmt(avctx->codec->sample_fmts[i])) { avctx->sample_fmt = avctx->codec->sample_fmts[i]; break; } } if (avctx->codec->sample_fmts[i] == AV_SAMPLE_FMT_NONE) { char buf[128]; snprintf(buf, sizeof(buf), "%d", avctx->sample_fmt); av_log(avctx, AV_LOG_ERROR, "Specified sample format %s is invalid or not supported\n", (char *)av_x_if_null(av_get_sample_fmt_name(avctx->sample_fmt), buf)); ret = AVERROR(EINVAL); goto free_and_end; } } if (avctx->codec->pix_fmts) { for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++) if (avctx->pix_fmt == avctx->codec->pix_fmts[i]) break; if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE && !((avctx->codec_id == AV_CODEC_ID_MJPEG || avctx->codec_id == AV_CODEC_ID_LJPEG) && avctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL)) { char buf[128]; snprintf(buf, sizeof(buf), "%d", avctx->pix_fmt); av_log(avctx, AV_LOG_ERROR, "Specified pixel format %s is invalid or not supported\n", (char *)av_x_if_null(av_get_pix_fmt_name(avctx->pix_fmt), buf)); ret = AVERROR(EINVAL); goto free_and_end; } if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ420P || avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ411P || avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ422P || avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ440P || avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P) avctx->color_range = AVCOL_RANGE_JPEG; } if (avctx->codec->supported_samplerates) { for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++) if (avctx->sample_rate == avctx->codec->supported_samplerates[i]) break; if (avctx->codec->supported_samplerates[i] == 0) { av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n", avctx->sample_rate); ret = AVERROR(EINVAL); goto free_and_end; } } if (avctx->sample_rate < 0) { av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n", avctx->sample_rate); ret = AVERROR(EINVAL); goto free_and_end; } if (avctx->codec->channel_layouts) { if (!avctx->channel_layout) { av_log(avctx, AV_LOG_WARNING, "Channel layout not specified\n"); } else { for (i = 0; avctx->codec->channel_layouts[i] != 0; i++) if (avctx->channel_layout == avctx->codec->channel_layouts[i]) break; if (avctx->codec->channel_layouts[i] == 0) { char buf[512]; av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); av_log(avctx, AV_LOG_ERROR, "Specified channel layout '%s' is not supported\n", buf); ret = AVERROR(EINVAL); goto free_and_end; } } } if (avctx->channel_layout && avctx->channels) { int channels = av_get_channel_layout_nb_channels(avctx->channel_layout); if (channels != avctx->channels) { char buf[512]; av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); av_log(avctx, AV_LOG_ERROR, "Channel layout '%s' with %d channels does not match number of specified channels %d\n", buf, channels, avctx->channels); ret = AVERROR(EINVAL); goto free_and_end; } } else if (avctx->channel_layout) { avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout); } if (avctx->channels < 0) { av_log(avctx, AV_LOG_ERROR, "Specified number of channels %d is not supported\n", avctx->channels); ret = AVERROR(EINVAL); goto free_and_end; } if(avctx->codec_type == AVMEDIA_TYPE_VIDEO) { pixdesc = av_pix_fmt_desc_get(avctx->pix_fmt); if ( avctx->bits_per_raw_sample < 0 || (avctx->bits_per_raw_sample > 8 && pixdesc->comp[0].depth <= 8)) { av_log(avctx, AV_LOG_WARNING, "Specified bit depth %d not possible with the specified pixel formats depth %d\n", avctx->bits_per_raw_sample, pixdesc->comp[0].depth); avctx->bits_per_raw_sample = pixdesc->comp[0].depth; } if (avctx->width <= 0 || avctx->height <= 0) { av_log(avctx, AV_LOG_ERROR, "dimensions not set\n"); ret = AVERROR(EINVAL); goto free_and_end; } } if ( (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) && avctx->bit_rate>0 && avctx->bit_rate<1000) { av_log(avctx, AV_LOG_WARNING, "Bitrate %"PRId64" is extremely low, maybe you mean %"PRId64"k\n", avctx->bit_rate, avctx->bit_rate); } if (!avctx->rc_initial_buffer_occupancy) avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3LL / 4; if (avctx->ticks_per_frame && avctx->time_base.num && avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) { av_log(avctx, AV_LOG_ERROR, "ticks_per_frame %d too large for the timebase %d/%d.", avctx->ticks_per_frame, avctx->time_base.num, avctx->time_base.den); goto free_and_end; } if (avctx->hw_frames_ctx) { AVHWFramesContext *frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data; if (frames_ctx->format != avctx->pix_fmt) { av_log(avctx, AV_LOG_ERROR, "Mismatching AVCodecContext.pix_fmt and AVHWFramesContext.format\n"); ret = AVERROR(EINVAL); goto free_and_end; } if (avctx->sw_pix_fmt != AV_PIX_FMT_NONE && avctx->sw_pix_fmt != frames_ctx->sw_format) { av_log(avctx, AV_LOG_ERROR, "Mismatching AVCodecContext.sw_pix_fmt (%s) " "and AVHWFramesContext.sw_format (%s)\n", av_get_pix_fmt_name(avctx->sw_pix_fmt), av_get_pix_fmt_name(frames_ctx->sw_format)); ret = AVERROR(EINVAL); goto free_and_end; } avctx->sw_pix_fmt = frames_ctx->sw_format; } } avctx->pts_correction_num_faulty_pts = avctx->pts_correction_num_faulty_dts = 0; avctx->pts_correction_last_pts = avctx->pts_correction_last_dts = INT64_MIN; if ( !CONFIG_GRAY && avctx->flags & AV_CODEC_FLAG_GRAY && avctx->codec_descriptor->type == AVMEDIA_TYPE_VIDEO) av_log(avctx, AV_LOG_WARNING, "gray decoding requested but not enabled at configuration time\n"); if ( avctx->codec->init && (!(avctx->active_thread_type&FF_THREAD_FRAME) || avctx->internal->frame_thread_encoder)) { ret = avctx->codec->init(avctx); if (ret < 0) { goto free_and_end; } codec_init_ok = 1; } ret=0; if (av_codec_is_decoder(avctx->codec)) { if (!avctx->bit_rate) avctx->bit_rate = get_bit_rate(avctx); /* validate channel layout from the decoder */ if (avctx->channel_layout) { int channels = av_get_channel_layout_nb_channels(avctx->channel_layout); if (!avctx->channels) avctx->channels = channels; else if (channels != avctx->channels) { char buf[512]; av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); av_log(avctx, AV_LOG_WARNING, "Channel layout '%s' with %d channels does not match specified number of channels %d: " "ignoring specified channel layout\n", buf, channels, avctx->channels); avctx->channel_layout = 0; } } if (avctx->channels && avctx->channels < 0 || avctx->channels > FF_SANE_NB_CHANNELS) { ret = AVERROR(EINVAL); goto free_and_end; } if (avctx->bits_per_coded_sample < 0) { ret = AVERROR(EINVAL); goto free_and_end; } if (avctx->sub_charenc) { if (avctx->codec_type != AVMEDIA_TYPE_SUBTITLE) { av_log(avctx, AV_LOG_ERROR, "Character encoding is only " "supported with subtitles codecs\n"); ret = AVERROR(EINVAL); goto free_and_end; } else if (avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB) { av_log(avctx, AV_LOG_WARNING, "Codec '%s' is bitmap-based, " "subtitles character encoding will be ignored\n", avctx->codec_descriptor->name); avctx->sub_charenc_mode = FF_SUB_CHARENC_MODE_DO_NOTHING; } else { /* input character encoding is set for a text based subtitle * codec at this point */ if (avctx->sub_charenc_mode == FF_SUB_CHARENC_MODE_AUTOMATIC) avctx->sub_charenc_mode = FF_SUB_CHARENC_MODE_PRE_DECODER; if (avctx->sub_charenc_mode == FF_SUB_CHARENC_MODE_PRE_DECODER) { #if CONFIG_ICONV iconv_t cd = iconv_open("UTF-8", avctx->sub_charenc); if (cd == (iconv_t)-1) { ret = AVERROR(errno); av_log(avctx, AV_LOG_ERROR, "Unable to open iconv context " "with input character encoding \"%s\"\n", avctx->sub_charenc); goto free_and_end; } iconv_close(cd); #else av_log(avctx, AV_LOG_ERROR, "Character encoding subtitles " "conversion needs a libavcodec built with iconv support " "for this codec\n"); ret = AVERROR(ENOSYS); goto free_and_end; #endif } } } #if FF_API_AVCTX_TIMEBASE if (avctx->framerate.num > 0 && avctx->framerate.den > 0) avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1})); #endif } if (codec->priv_data_size > 0 && avctx->priv_data && codec->priv_class) { av_assert0(*(const AVClass **)avctx->priv_data == codec->priv_class); } end: ff_unlock_avcodec(codec); if (options) { av_dict_free(options); *options = tmp; } return ret; free_and_end: if (avctx->codec && (codec_init_ok || (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP))) avctx->codec->close(avctx); if (codec->priv_class && codec->priv_data_size) av_opt_free(avctx->priv_data); av_opt_free(avctx); #if FF_API_CODED_FRAME FF_DISABLE_DEPRECATION_WARNINGS av_frame_free(&avctx->coded_frame); FF_ENABLE_DEPRECATION_WARNINGS #endif av_dict_free(&tmp); av_freep(&avctx->priv_data); if (avctx->internal) { av_frame_free(&avctx->internal->to_free); av_frame_free(&avctx->internal->compat_decode_frame); av_frame_free(&avctx->internal->buffer_frame); av_packet_free(&avctx->internal->buffer_pkt); av_packet_free(&avctx->internal->last_pkt_props); av_packet_free(&avctx->internal->ds.in_pkt); ff_decode_bsfs_uninit(avctx); av_freep(&avctx->internal->pool); } av_freep(&avctx->internal); avctx->codec = NULL; goto end; }
3313
True
1
CVE-2019-17542
False
False
False
False
AV:N/AC:L/Au:N/C:P/I:P/A:P
NETWORK
LOW
NONE
PARTIAL
PARTIAL
PARTIAL
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
HIGH
HIGH
HIGH
9.8
CRITICAL
3.9
5.9
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/02f909dc24b1f05cfbba75077c7707b905e63cd2', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/02f909dc24b1f05cfbba75077c7707b905e63cd2', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15919', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15919', 'refsource': 'MISC', 'tags': ['Issue Tracking', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2019/12/msg00003.html', 'name': '[debian-lts-announce] 20191205 [SECURITY] [DLA 2021-1] libav security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202003-65', 'name': 'GLSA-202003-65', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2020/dsa-4722', 'name': 'DSA-4722', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/07/msg00022.html', 'name': '[debian-lts-announce] 20200727 [SECURITY] [DLA 2291-1] ffmpeg security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4431-1/', 'name': 'USN-4431-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
HIGH
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionEndExcluding': '2.8.16', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.2', 'versionEndExcluding': '3.2.15', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '3.4', 'versionEndExcluding': '3.4.7', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.0', 'versionEndExcluding': '4.0.5', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.1', 'versionEndExcluding': '4.1.5', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:20.04:*:*:*:lts:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'FFmpeg before 4.2 has a heap-based buffer overflow in vqa_decode_chunk because of an out-of-array access in vqa_decode_init in libavcodec/vqavideo.c.'}]
2021-07-21T11:39Z
2019-10-14T02:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Michael Niedermayer
2019-07-26 00:35:32+02:00
avcodec/vqavideo: Set video size Fixes: out of array access Fixes: 15919/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-5657368257363968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
02f909dc24b1f05cfbba75077c7707b905e63cd2
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
vqa_decode_init
vqa_decode_init( AVCodecContext * avctx)
['avctx']
static av_cold int vqa_decode_init(AVCodecContext *avctx) { VqaContext *s = avctx->priv_data; int i, j, codebook_index, ret; s->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_PAL8; /* make sure the extradata made it */ if (s->avctx->extradata_size != VQA_HEADER_SIZE) { av_log(s->avctx, AV_LOG_ERROR, "expected extradata size of %d\n", VQA_HEADER_SIZE); return AVERROR(EINVAL); } /* load up the VQA parameters from the header */ s->vqa_version = s->avctx->extradata[0]; switch (s->vqa_version) { case 1: case 2: break; case 3: avpriv_report_missing_feature(avctx, "VQA Version %d", s->vqa_version); return AVERROR_PATCHWELCOME; default: avpriv_request_sample(avctx, "VQA Version %i", s->vqa_version); return AVERROR_PATCHWELCOME; } s->width = AV_RL16(&s->avctx->extradata[6]); s->height = AV_RL16(&s->avctx->extradata[8]); if ((ret = av_image_check_size(s->width, s->height, 0, avctx)) < 0) { s->width= s->height= 0; return ret; } s->vector_width = s->avctx->extradata[10]; s->vector_height = s->avctx->extradata[11]; s->partial_count = s->partial_countdown = s->avctx->extradata[13]; /* the vector dimensions have to meet very stringent requirements */ if ((s->vector_width != 4) || ((s->vector_height != 2) && (s->vector_height != 4))) { /* return without further initialization */ return AVERROR_INVALIDDATA; } if (s->width % s->vector_width || s->height % s->vector_height) { av_log(avctx, AV_LOG_ERROR, "Image size not multiple of block size\n"); return AVERROR_INVALIDDATA; } /* allocate codebooks */ s->codebook_size = MAX_CODEBOOK_SIZE; s->codebook = av_malloc(s->codebook_size); if (!s->codebook) goto fail; s->next_codebook_buffer = av_malloc(s->codebook_size); if (!s->next_codebook_buffer) goto fail; /* allocate decode buffer */ s->decode_buffer_size = (s->width / s->vector_width) * (s->height / s->vector_height) * 2; s->decode_buffer = av_mallocz(s->decode_buffer_size); if (!s->decode_buffer) goto fail; /* initialize the solid-color vectors */ if (s->vector_height == 4) { codebook_index = 0xFF00 * 16; for (i = 0; i < 256; i++) for (j = 0; j < 16; j++) s->codebook[codebook_index++] = i; } else { codebook_index = 0xF00 * 8; for (i = 0; i < 256; i++) for (j = 0; j < 8; j++) s->codebook[codebook_index++] = i; } s->next_codebook_buffer_index = 0; return 0; fail: av_freep(&s->codebook); av_freep(&s->next_codebook_buffer); av_freep(&s->decode_buffer); return AVERROR(ENOMEM); }
543
True
1
CVE-2020-35964
False
False
False
True
AV:N/AC:M/Au:N/C:N/I:N/A:P
NETWORK
MEDIUM
NONE
NONE
NONE
PARTIAL
4.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
NONE
NONE
HIGH
6.5
MEDIUM
2.8
3.6
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/27a99e2c7d450fef15594671eef4465c8a166bd7', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/27a99e2c7d450fef15594671eef4465c8a166bd7', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26622', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26622', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-24', 'name': 'GLSA-202105-24', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'AND', 'children': [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.3.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': False, 'cpe23Uri': 'cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*', 'cpe_name': []}]}], 'cpe_match': []}]
[{'lang': 'en', 'value': 'track_header in libavformat/vividas.c in FFmpeg 4.3.1 has an out-of-bounds write because of incorrect extradata packing.'}]
2022-08-06T03:23Z
2021-01-03T19:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Michael Niedermayer
2020-10-28 20:11:54+01:00
avformat/vividas: improve extradata packing checks in track_header() Fixes: out of array accesses Fixes: 26622/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6581200338288640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
27a99e2c7d450fef15594671eef4465c8a166bd7
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
track_header
track_header( VividasDemuxContext * viv , AVFormatContext * s , uint8_t * buf , int size)
['viv', 's', 'buf', 'size']
static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *buf, int size) { int i, j, ret; int64_t off; int val_1; int num_video; AVIOContext pb0, *pb = &pb0; ffio_init_context(pb, buf, size, 0, NULL, NULL, NULL, NULL); ffio_read_varlen(pb); // track_header_len avio_r8(pb); // '1' val_1 = ffio_read_varlen(pb); for (i=0;i<val_1;i++) { int c = avio_r8(pb); if (avio_feof(pb)) return AVERROR_EOF; for (j=0;j<c;j++) { if (avio_feof(pb)) return AVERROR_EOF; avio_r8(pb); // val_3 avio_r8(pb); // val_4 } } avio_r8(pb); // num_streams off = avio_tell(pb); off += ffio_read_varlen(pb); // val_5 avio_r8(pb); // '2' num_video = avio_r8(pb); avio_seek(pb, off, SEEK_SET); if (num_video != 1) { av_log(s, AV_LOG_ERROR, "number of video tracks %d is not 1\n", num_video); return AVERROR_PATCHWELCOME; } for (i = 0; i < num_video; i++) { AVStream *st = avformat_new_stream(s, NULL); int num, den; if (!st) return AVERROR(ENOMEM); st->id = i; st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; st->codecpar->codec_id = AV_CODEC_ID_VP6; off = avio_tell(pb); off += ffio_read_varlen(pb); avio_r8(pb); // '3' avio_r8(pb); // val_7 num = avio_rl32(pb); // frame_time den = avio_rl32(pb); // time_base avpriv_set_pts_info(st, 64, num, den); st->nb_frames = avio_rl32(pb); // n frames st->codecpar->width = avio_rl16(pb); // width st->codecpar->height = avio_rl16(pb); // height avio_r8(pb); // val_8 avio_rl32(pb); // val_9 avio_seek(pb, off, SEEK_SET); } off = avio_tell(pb); off += ffio_read_varlen(pb); // val_10 avio_r8(pb); // '4' viv->num_audio = avio_r8(pb); avio_seek(pb, off, SEEK_SET); if (viv->num_audio != 1) av_log(s, AV_LOG_WARNING, "number of audio tracks %d is not 1\n", viv->num_audio); for(i=0;i<viv->num_audio;i++) { int q; AVStream *st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->id = num_video + i; st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_VORBIS; off = avio_tell(pb); off += ffio_read_varlen(pb); // length avio_r8(pb); // '5' avio_r8(pb); //codec_id avio_rl16(pb); //codec_subid st->codecpar->channels = avio_rl16(pb); // channels st->codecpar->sample_rate = avio_rl32(pb); // sample_rate avio_seek(pb, 10, SEEK_CUR); // data_1 q = avio_r8(pb); avio_seek(pb, q, SEEK_CUR); // data_2 avio_r8(pb); // zeropad if (avio_tell(pb) < off) { int num_data; int xd_size = 0; int data_len[256]; int offset = 1; uint8_t *p; ffio_read_varlen(pb); // val_13 avio_r8(pb); // '19' ffio_read_varlen(pb); // len_3 num_data = avio_r8(pb); for (j = 0; j < num_data; j++) { uint64_t len = ffio_read_varlen(pb); if (len > INT_MAX/2 - xd_size) { return AVERROR_INVALIDDATA; } data_len[j] = len; xd_size += len; } ret = ff_alloc_extradata(st->codecpar, 64 + xd_size + xd_size / 255); if (ret < 0) return ret; p = st->codecpar->extradata; p[0] = 2; for (j = 0; j < num_data - 1; j++) { unsigned delta = av_xiphlacing(&p[offset], data_len[j]); if (delta > data_len[j]) { return AVERROR_INVALIDDATA; } offset += delta; } for (j = 0; j < num_data; j++) { int ret = avio_read(pb, &p[offset], data_len[j]); if (ret < data_len[j]) { st->codecpar->extradata_size = 0; av_freep(&st->codecpar->extradata); break; } offset += data_len[j]; } if (offset < st->codecpar->extradata_size) st->codecpar->extradata_size = offset; } } return 0; }
869
True
1
CVE-2020-35965
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/3e5959b3457f7f1856d997261e6ac672bba49e8b', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/3e5959b3457f7f1856d997261e6ac672bba49e8b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26532', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26532', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/b0a8b40294ea212c1938348ff112ef1b9bf16bb3', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/b0a8b40294ea212c1938348ff112ef1b9bf16bb3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/01/msg00026.html', 'name': '[debian-lts-announce] 20210131 [SECURITY] [DLA 2537-1] ffmpeg security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-24', 'name': 'GLSA-202105-24', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4990', 'name': 'DSA-4990', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.3.1', 'versionEndExcluding': '4.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'decode_frame in libavcodec/exr.c in FFmpeg 4.3.1 has an out-of-bounds write because of errors in calculations of when to perform memset zero operations.'}]
2021-11-05T21:57Z
2021-01-04T02:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Michael Niedermayer
2020-10-24 22:21:48+02:00
avcodec/exr: Check ymin vs. h Fixes: out of array access Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344 Fixes: 27443/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5631239813595136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
3e5959b3457f7f1856d997261e6ac672bba49e8b
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
decode_frame
decode_frame( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt)
['avctx', 'data', 'got_frame', 'avpkt']
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { EXRContext *s = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *picture = data; uint8_t *ptr; int i, y, ret, ymax; int planes; int out_line_size; int nb_blocks; /* nb scanline or nb tile */ uint64_t start_offset_table; uint64_t start_next_scanline; PutByteContext offset_table_writer; bytestream2_init(&s->gb, avpkt->data, avpkt->size); if ((ret = decode_header(s, picture)) < 0) return ret; switch (s->pixel_type) { case EXR_FLOAT: case EXR_HALF: if (s->channel_offsets[3] >= 0) { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_GBRAPF32; } else { /* todo: change this when a floating point pixel format with luma with alpha is implemented */ avctx->pix_fmt = AV_PIX_FMT_GBRAPF32; } } else { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_GBRPF32; } else { avctx->pix_fmt = AV_PIX_FMT_GRAYF32; } } break; case EXR_UINT: if (s->channel_offsets[3] >= 0) { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_RGBA64; } else { avctx->pix_fmt = AV_PIX_FMT_YA16; } } else { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_RGB48; } else { avctx->pix_fmt = AV_PIX_FMT_GRAY16; } } break; default: av_log(avctx, AV_LOG_ERROR, "Missing channel list.\n"); return AVERROR_INVALIDDATA; } if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED) avctx->color_trc = s->apply_trc_type; switch (s->compression) { case EXR_RAW: case EXR_RLE: case EXR_ZIP1: s->scan_lines_per_block = 1; break; case EXR_PXR24: case EXR_ZIP16: s->scan_lines_per_block = 16; break; case EXR_PIZ: case EXR_B44: case EXR_B44A: s->scan_lines_per_block = 32; break; default: avpriv_report_missing_feature(avctx, "Compression %d", s->compression); return AVERROR_PATCHWELCOME; } /* Verify the xmin, xmax, ymin and ymax before setting the actual image size. * It's possible for the data window can larger or outside the display window */ if (s->xmin > s->xmax || s->ymin > s->ymax || s->ydelta == 0xFFFFFFFF || s->xdelta == 0xFFFFFFFF) { av_log(avctx, AV_LOG_ERROR, "Wrong or missing size information.\n"); return AVERROR_INVALIDDATA; } if ((ret = ff_set_dimensions(avctx, s->w, s->h)) < 0) return ret; s->desc = av_pix_fmt_desc_get(avctx->pix_fmt); if (!s->desc) return AVERROR_INVALIDDATA; if (s->desc->flags & AV_PIX_FMT_FLAG_FLOAT) { planes = s->desc->nb_components; out_line_size = avctx->width * 4; } else { planes = 1; out_line_size = avctx->width * 2 * s->desc->nb_components; } if (s->is_tile) { nb_blocks = ((s->xdelta + s->tile_attr.xSize - 1) / s->tile_attr.xSize) * ((s->ydelta + s->tile_attr.ySize - 1) / s->tile_attr.ySize); } else { /* scanline */ nb_blocks = (s->ydelta + s->scan_lines_per_block - 1) / s->scan_lines_per_block; } if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) return ret; if (bytestream2_get_bytes_left(&s->gb)/8 < nb_blocks) return AVERROR_INVALIDDATA; // check offset table and recreate it if need if (!s->is_tile && bytestream2_peek_le64(&s->gb) == 0) { av_log(s->avctx, AV_LOG_DEBUG, "recreating invalid scanline offset table\n"); start_offset_table = bytestream2_tell(&s->gb); start_next_scanline = start_offset_table + nb_blocks * 8; bytestream2_init_writer(&offset_table_writer, &avpkt->data[start_offset_table], nb_blocks * 8); for (y = 0; y < nb_blocks; y++) { /* write offset of prev scanline in offset table */ bytestream2_put_le64(&offset_table_writer, start_next_scanline); /* get len of next scanline */ bytestream2_seek(&s->gb, start_next_scanline + 4, SEEK_SET);/* skip line number */ start_next_scanline += (bytestream2_get_le32(&s->gb) + 8); } bytestream2_seek(&s->gb, start_offset_table, SEEK_SET); } // save pointer we are going to use in decode_block s->buf = avpkt->data; s->buf_size = avpkt->size; // Zero out the start if ymin is not 0 for (i = 0; i < planes; i++) { ptr = picture->data[i]; for (y = 0; y < s->ymin; y++) { memset(ptr, 0, out_line_size); ptr += picture->linesize[i]; } } s->picture = picture; avctx->execute2(avctx, decode_block, s->thread_data, NULL, nb_blocks); ymax = FFMAX(0, s->ymax + 1); // Zero out the end if ymax+1 is not h for (i = 0; i < planes; i++) { ptr = picture->data[i] + (ymax * picture->linesize[i]); for (y = ymax; y < avctx->height; y++) { memset(ptr, 0, out_line_size); ptr += picture->linesize[i]; } } picture->pict_type = AV_PICTURE_TYPE_I; *got_frame = 1; return avpkt->size; }
937
True
1
CVE-2020-35965
False
False
False
False
AV:N/AC:L/Au:N/C:N/I:N/A:P
NETWORK
LOW
NONE
NONE
NONE
PARTIAL
5.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NETWORK
LOW
NONE
NONE
UNCHANGED
NONE
NONE
HIGH
7.5
HIGH
3.9
3.6
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/3e5959b3457f7f1856d997261e6ac672bba49e8b', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/3e5959b3457f7f1856d997261e6ac672bba49e8b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26532', 'name': 'https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26532', 'refsource': 'MISC', 'tags': ['Exploit', 'Issue Tracking', 'Third Party Advisory']}, {'url': 'https://github.com/FFmpeg/FFmpeg/commit/b0a8b40294ea212c1938348ff112ef1b9bf16bb3', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/b0a8b40294ea212c1938348ff112ef1b9bf16bb3', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://lists.debian.org/debian-lts-announce/2021/01/msg00026.html', 'name': '[debian-lts-announce] 20210131 [SECURITY] [DLA 2537-1] ffmpeg security update', 'refsource': 'MLIST', 'tags': ['Mailing List', 'Third Party Advisory']}, {'url': 'https://security.gentoo.org/glsa/202105-24', 'name': 'GLSA-202105-24', 'refsource': 'GENTOO', 'tags': ['Third Party Advisory']}, {'url': 'https://www.debian.org/security/2021/dsa-4990', 'name': 'DSA-4990', 'refsource': 'DEBIAN', 'tags': ['Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-787'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*', 'versionStartIncluding': '4.3.1', 'versionEndExcluding': '4.4', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'decode_frame in libavcodec/exr.c in FFmpeg 4.3.1 has an out-of-bounds write because of errors in calculations of when to perform memset zero operations.'}]
2021-11-05T21:57Z
2021-01-04T02:15Z
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.
https://cwe.mitre.org/data/definitions/787.html
0
Michael Niedermayer
2020-10-25 00:23:12+02:00
avcodec/exr: skip bottom clearing loop when its outside the image Fixes: signed integer overflow: 1633771809 * 32960 cannot be represented in type 'int' Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
b0a8b40294ea212c1938348ff112ef1b9bf16bb3
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
decode_frame
decode_frame( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt)
['avctx', 'data', 'got_frame', 'avpkt']
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { EXRContext *s = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *picture = data; uint8_t *ptr; int i, y, ret, ymax; int planes; int out_line_size; int nb_blocks; /* nb scanline or nb tile */ uint64_t start_offset_table; uint64_t start_next_scanline; PutByteContext offset_table_writer; bytestream2_init(&s->gb, avpkt->data, avpkt->size); if ((ret = decode_header(s, picture)) < 0) return ret; switch (s->pixel_type) { case EXR_FLOAT: case EXR_HALF: if (s->channel_offsets[3] >= 0) { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_GBRAPF32; } else { /* todo: change this when a floating point pixel format with luma with alpha is implemented */ avctx->pix_fmt = AV_PIX_FMT_GBRAPF32; } } else { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_GBRPF32; } else { avctx->pix_fmt = AV_PIX_FMT_GRAYF32; } } break; case EXR_UINT: if (s->channel_offsets[3] >= 0) { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_RGBA64; } else { avctx->pix_fmt = AV_PIX_FMT_YA16; } } else { if (!s->is_luma) { avctx->pix_fmt = AV_PIX_FMT_RGB48; } else { avctx->pix_fmt = AV_PIX_FMT_GRAY16; } } break; default: av_log(avctx, AV_LOG_ERROR, "Missing channel list.\n"); return AVERROR_INVALIDDATA; } if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED) avctx->color_trc = s->apply_trc_type; switch (s->compression) { case EXR_RAW: case EXR_RLE: case EXR_ZIP1: s->scan_lines_per_block = 1; break; case EXR_PXR24: case EXR_ZIP16: s->scan_lines_per_block = 16; break; case EXR_PIZ: case EXR_B44: case EXR_B44A: s->scan_lines_per_block = 32; break; default: avpriv_report_missing_feature(avctx, "Compression %d", s->compression); return AVERROR_PATCHWELCOME; } /* Verify the xmin, xmax, ymin and ymax before setting the actual image size. * It's possible for the data window can larger or outside the display window */ if (s->xmin > s->xmax || s->ymin > s->ymax || s->ydelta == 0xFFFFFFFF || s->xdelta == 0xFFFFFFFF) { av_log(avctx, AV_LOG_ERROR, "Wrong or missing size information.\n"); return AVERROR_INVALIDDATA; } if ((ret = ff_set_dimensions(avctx, s->w, s->h)) < 0) return ret; s->desc = av_pix_fmt_desc_get(avctx->pix_fmt); if (!s->desc) return AVERROR_INVALIDDATA; if (s->desc->flags & AV_PIX_FMT_FLAG_FLOAT) { planes = s->desc->nb_components; out_line_size = avctx->width * 4; } else { planes = 1; out_line_size = avctx->width * 2 * s->desc->nb_components; } if (s->is_tile) { nb_blocks = ((s->xdelta + s->tile_attr.xSize - 1) / s->tile_attr.xSize) * ((s->ydelta + s->tile_attr.ySize - 1) / s->tile_attr.ySize); } else { /* scanline */ nb_blocks = (s->ydelta + s->scan_lines_per_block - 1) / s->scan_lines_per_block; } if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) return ret; if (bytestream2_get_bytes_left(&s->gb)/8 < nb_blocks) return AVERROR_INVALIDDATA; // check offset table and recreate it if need if (!s->is_tile && bytestream2_peek_le64(&s->gb) == 0) { av_log(s->avctx, AV_LOG_DEBUG, "recreating invalid scanline offset table\n"); start_offset_table = bytestream2_tell(&s->gb); start_next_scanline = start_offset_table + nb_blocks * 8; bytestream2_init_writer(&offset_table_writer, &avpkt->data[start_offset_table], nb_blocks * 8); for (y = 0; y < nb_blocks; y++) { /* write offset of prev scanline in offset table */ bytestream2_put_le64(&offset_table_writer, start_next_scanline); /* get len of next scanline */ bytestream2_seek(&s->gb, start_next_scanline + 4, SEEK_SET);/* skip line number */ start_next_scanline += (bytestream2_get_le32(&s->gb) + 8); } bytestream2_seek(&s->gb, start_offset_table, SEEK_SET); } // save pointer we are going to use in decode_block s->buf = avpkt->data; s->buf_size = avpkt->size; // Zero out the start if ymin is not 0 for (i = 0; i < planes; i++) { ptr = picture->data[i]; for (y = 0; y < FFMIN(s->ymin, s->h); y++) { memset(ptr, 0, out_line_size); ptr += picture->linesize[i]; } } s->picture = picture; avctx->execute2(avctx, decode_block, s->thread_data, NULL, nb_blocks); ymax = FFMAX(0, s->ymax + 1); // Zero out the end if ymax+1 is not h for (i = 0; i < planes; i++) { ptr = picture->data[i] + (ymax * picture->linesize[i]); for (y = ymax; y < avctx->height; y++) { memset(ptr, 0, out_line_size); ptr += picture->linesize[i]; } } picture->pict_type = AV_PICTURE_TYPE_I; *got_frame = 1; return avpkt->size; }
944
True
1
CVE-2021-33815
False
False
False
True
AV:N/AC:M/Au:N/C:P/I:P/A:P
NETWORK
MEDIUM
NONE
PARTIAL
PARTIAL
PARTIAL
6.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NETWORK
LOW
NONE
REQUIRED
UNCHANGED
HIGH
HIGH
HIGH
8.8
HIGH
2.8
5.9
False
[{'url': 'https://github.com/FFmpeg/FFmpeg/commit/26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777', 'name': 'https://github.com/FFmpeg/FFmpeg/commit/26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}]
[{'description': [{'lang': 'en', 'value': 'CWE-129'}]}]
MEDIUM
[{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:ffmpeg:ffmpeg:4.4:*:*:*:*:*:*:*', 'cpe_name': []}]}]
[{'lang': 'en', 'value': 'dwa_uncompress in libavcodec/exr.c in FFmpeg 4.4 allows an out-of-bounds array access because dc_count is not strictly checked.'}]
2021-06-07T16:04Z
2021-06-03T17:15Z
Improper Validation of Array Index
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.
https://cwe.mitre.org/data/definitions/129.html
0
Michael Niedermayer
2021-05-25 19:29:18+02:00
avcodec/exr: More strictly check dc_count Fixes: out of array access Fixes: exr/deneme Found-by: Burak Çarıkçı <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777
False
FFmpeg/FFmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
2011-04-14 14:12:38
2022-08-27 15:20:04
https://ffmpeg.org/
FFmpeg
31375.0
10012.0
dwa_uncompress
dwa_uncompress( EXRContext * s , const uint8_t * src , int compressed_size , int uncompressed_size , EXRThreadData * td)
['s', 'src', 'compressed_size', 'uncompressed_size', 'td']
static int dwa_uncompress(EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) { int64_t version, lo_usize, lo_size; int64_t ac_size, dc_size, rle_usize, rle_csize, rle_raw_size; int64_t ac_count, dc_count, ac_compression; const int dc_w = td->xsize >> 3; const int dc_h = td->ysize >> 3; GetByteContext gb, agb; int skip, ret; if (compressed_size <= 88) return AVERROR_INVALIDDATA; version = AV_RL64(src + 0); if (version != 2) return AVERROR_INVALIDDATA; lo_usize = AV_RL64(src + 8); lo_size = AV_RL64(src + 16); ac_size = AV_RL64(src + 24); dc_size = AV_RL64(src + 32); rle_csize = AV_RL64(src + 40); rle_usize = AV_RL64(src + 48); rle_raw_size = AV_RL64(src + 56); ac_count = AV_RL64(src + 64); dc_count = AV_RL64(src + 72); ac_compression = AV_RL64(src + 80); if (compressed_size < 88LL + lo_size + ac_size + dc_size + rle_csize) return AVERROR_INVALIDDATA; bytestream2_init(&gb, src + 88, compressed_size - 88); skip = bytestream2_get_le16(&gb); if (skip < 2) return AVERROR_INVALIDDATA; bytestream2_skip(&gb, skip - 2); if (lo_size > 0) { if (lo_usize > uncompressed_size) return AVERROR_INVALIDDATA; bytestream2_skip(&gb, lo_size); } if (ac_size > 0) { unsigned long dest_len = ac_count * 2LL; GetByteContext agb = gb; if (ac_count > 3LL * td->xsize * s->scan_lines_per_block) return AVERROR_INVALIDDATA; av_fast_padded_malloc(&td->ac_data, &td->ac_size, dest_len); if (!td->ac_data) return AVERROR(ENOMEM); switch (ac_compression) { case 0: ret = huf_uncompress(s, td, &agb, (int16_t *)td->ac_data, ac_count); if (ret < 0) return ret; break; case 1: if (uncompress(td->ac_data, &dest_len, agb.buffer, ac_size) != Z_OK || dest_len != ac_count * 2LL) return AVERROR_INVALIDDATA; break; default: return AVERROR_INVALIDDATA; } bytestream2_skip(&gb, ac_size); } if (dc_size > 0) { unsigned long dest_len = dc_count * 2LL; GetByteContext agb = gb; if (dc_count > (6LL * td->xsize * td->ysize + 63) / 64) return AVERROR_INVALIDDATA; av_fast_padded_malloc(&td->dc_data, &td->dc_size, FFALIGN(dest_len, 64) * 2); if (!td->dc_data) return AVERROR(ENOMEM); if (uncompress(td->dc_data + FFALIGN(dest_len, 64), &dest_len, agb.buffer, dc_size) != Z_OK || (dest_len != dc_count * 2LL)) return AVERROR_INVALIDDATA; s->dsp.predictor(td->dc_data + FFALIGN(dest_len, 64), dest_len); s->dsp.reorder_pixels(td->dc_data, td->dc_data + FFALIGN(dest_len, 64), dest_len); bytestream2_skip(&gb, dc_size); } if (rle_raw_size > 0 && rle_csize > 0 && rle_usize > 0) { unsigned long dest_len = rle_usize; av_fast_padded_malloc(&td->rle_data, &td->rle_size, rle_usize); if (!td->rle_data) return AVERROR(ENOMEM); av_fast_padded_malloc(&td->rle_raw_data, &td->rle_raw_size, rle_raw_size); if (!td->rle_raw_data) return AVERROR(ENOMEM); if (uncompress(td->rle_data, &dest_len, gb.buffer, rle_csize) != Z_OK || (dest_len != rle_usize)) return AVERROR_INVALIDDATA; ret = rle(td->rle_raw_data, td->rle_data, rle_usize, rle_raw_size); if (ret < 0) return ret; bytestream2_skip(&gb, rle_csize); } bytestream2_init(&agb, td->ac_data, ac_count * 2); for (int y = 0; y < td->ysize; y += 8) { for (int x = 0; x < td->xsize; x += 8) { memset(td->block, 0, sizeof(td->block)); for (int j = 0; j < 3; j++) { float *block = td->block[j]; const int idx = (x >> 3) + (y >> 3) * dc_w + dc_w * dc_h * j; uint16_t *dc = (uint16_t *)td->dc_data; union av_intfloat32 dc_val; dc_val.i = half2float(dc[idx], s->mantissatable, s->exponenttable, s->offsettable); block[0] = dc_val.f; ac_uncompress(s, &agb, block); dct_inverse(block); } { const float scale = s->pixel_type == EXR_FLOAT ? 2.f : 1.f; const int o = s->nb_channels == 4; float *bo = ((float *)td->uncompressed_data) + y * td->xsize * s->nb_channels + td->xsize * (o + 0) + x; float *go = ((float *)td->uncompressed_data) + y * td->xsize * s->nb_channels + td->xsize * (o + 1) + x; float *ro = ((float *)td->uncompressed_data) + y * td->xsize * s->nb_channels + td->xsize * (o + 2) + x; float *yb = td->block[0]; float *ub = td->block[1]; float *vb = td->block[2]; for (int yy = 0; yy < 8; yy++) { for (int xx = 0; xx < 8; xx++) { const int idx = xx + yy * 8; convert(yb[idx], ub[idx], vb[idx], &bo[xx], &go[xx], &ro[xx]); bo[xx] = to_linear(bo[xx], scale); go[xx] = to_linear(go[xx], scale); ro[xx] = to_linear(ro[xx], scale); } bo += td->xsize * s->nb_channels; go += td->xsize * s->nb_channels; ro += td->xsize * s->nb_channels; } } } } if (s->nb_channels < 4) return 0; for (int y = 0; y < td->ysize && td->rle_raw_data; y++) { uint32_t *ao = ((uint32_t *)td->uncompressed_data) + y * td->xsize * s->nb_channels; uint8_t *ai0 = td->rle_raw_data + y * td->xsize; uint8_t *ai1 = td->rle_raw_data + y * td->xsize + rle_raw_size / 2; for (int x = 0; x < td->xsize; x++) { uint16_t ha = ai0[x] | (ai1[x] << 8); ao[x] = half2float(ha, s->mantissatable, s->exponenttable, s->offsettable); } } return 0; }
1404
True
1