idx
int64
0
522k
project
stringclasses
631 values
commit_id
stringlengths
7
40
project_url
stringclasses
630 values
commit_url
stringlengths
4
164
commit_message
stringlengths
0
11.5k
target
int64
0
1
func
stringlengths
5
484k
func_hash
float64
1,559,120,642,045,605,000,000,000B
340,279,892,905,069,500,000,000,000,000B
file_name
stringlengths
4
45
file_hash
float64
25,942,829,220,065,710,000,000,000B
340,272,304,251,680,200,000,000,000,000B
cwe
sequencelengths
0
1
cve
stringlengths
4
16
cve_desc
stringlengths
0
2.3k
nvd_url
stringlengths
37
49
10,834
libpcap
484d60cbf7ca4ec758c3cbb8a82d68b244a78d58
https://github.com/the-tcpdump-group/libpcap
https://github.com/the-tcpdump-group/libpcap/commit/484d60cbf7ca4ec758c3cbb8a82d68b244a78d58
On UN*X, don't tell the client why authentication failed. "no such user" tells the client that the user ID isn't valid and, therefore, that it needn't bother trying to do password cracking for that user ID; just saying that the authentication failed dosn't give them that hint. This resolves the third problem in Include Security issue F11: [libpcap] Remote Packet Capture Daemon Multiple Authentication Improvements. The Windows LogonUser() API returns ERROR_LOGON_FAILURE for both cases, so the Windows code doesn't have this issue. Just return the same "Authentication failed" message on Windows to the user. For various authentication failures *other* than "no such user" and "password not valid", log a message, as there's a problem that may need debugging. We don't need to tell the end user what the problem is, as they may not bother reporting it and, even if they do, they may not give the full error message.
1
daemon_AuthUserPwd(char *username, char *password, char *errbuf) { #ifdef _WIN32 /* * Warning: the user which launches the process must have the * SE_TCB_NAME right. * This corresponds to have the "Act as part of the Operating System" * turned on (administrative tools, local security settings, local * policies, user right assignment) * However, it seems to me that if you run it as a service, this * right should be provided by default. * * XXX - hopefully, this returns errors such as ERROR_LOGON_FAILURE, * which merely indicates that the user name or password is * incorrect, not whether it's the user name or the password * that's incorrect, so a client that's trying to brute-force * accounts doesn't know whether it's the user name or the * password that's incorrect, so it doesn't know whether to * stop trying to log in with a given user name and move on * to another user name. */ HANDLE Token; if (LogonUser(username, ".", password, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &Token) == 0) { pcap_fmt_errmsg_for_win32_err(errbuf, PCAP_ERRBUF_SIZE, GetLastError(), "LogonUser() failed"); return -1; } // This call should change the current thread to the selected user. // I didn't test it. if (ImpersonateLoggedOnUser(Token) == 0) { pcap_fmt_errmsg_for_win32_err(errbuf, PCAP_ERRBUF_SIZE, GetLastError(), "ImpersonateLoggedOnUser() failed"); CloseHandle(Token); return -1; } CloseHandle(Token); return 0; #else /* * See * * http://www.unixpapa.com/incnote/passwd.html * * We use the Solaris/Linux shadow password authentication if * we have getspnam(), otherwise we just do traditional * authentication, which, on some platforms, might work, even * with shadow passwords, if we're running as root. Traditional * authenticaion won't work if we're not running as root, as * I think these days all UN*Xes either won't return the password * at all with getpwnam() or will only do so if you're root. * * XXX - perhaps what we *should* be using is PAM, if we have * it. That might hide all the details of username/password * authentication, whether it's done with a visible-to-root- * only password database or some other authentication mechanism, * behind its API. */ struct passwd *user; char *user_password; #ifdef HAVE_GETSPNAM struct spwd *usersp; #endif char *crypt_password; // This call is needed to get the uid if ((user = getpwnam(username)) == NULL) { pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, "Authentication failed: user name or password incorrect"); return -1; } #ifdef HAVE_GETSPNAM // This call is needed to get the password; otherwise 'x' is returned if ((usersp = getspnam(username)) == NULL) { pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, "Authentication failed: user name or password incorrect"); return -1; } user_password = usersp->sp_pwdp; #else /* * XXX - what about other platforms? * The unixpapa.com page claims this Just Works on *BSD if you're * running as root - it's from 2000, so it doesn't indicate whether * macOS (which didn't come out until 2001, under the name Mac OS * X) behaves like the *BSDs or not, and might also work on AIX. * HP-UX does something else. * * Again, hopefully PAM hides all that. */ user_password = user->pw_passwd; #endif crypt_password = crypt(password, user_password); if (crypt_password == NULL) { pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, "Authentication failed"); return -1; } if (strcmp(user_password, crypt_password) != 0) { pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, "Authentication failed: user name or password incorrect"); return -1; } if (setuid(user->pw_uid)) { pcap_fmt_errmsg_for_errno(errbuf, PCAP_ERRBUF_SIZE, errno, "setuid"); return -1; } /* if (setgid(user->pw_gid)) { pcap_fmt_errmsg_for_errno(errbuf, PCAP_ERRBUF_SIZE, errno, "setgid"); return -1; } */ return 0; #endif }
143,271,537,862,841,350,000,000,000,000,000,000,000
daemon.c
39,444,760,337,349,555,000,000,000,000,000,000,000
[ "CWE-345" ]
CVE-2019-15162
rpcapd/daemon.c in libpcap before 1.9.1 on non-Windows platforms provides details about why authentication failed, which might make it easier for attackers to enumerate valid usernames.
https://nvd.nist.gov/vuln/detail/CVE-2019-15162
10,835
qemu
9878d173f574df74bde0ff50b2f81009fbee81bb
https://github.com/bonzini/qemu
https://git.qemu.org/?p=qemu.git;a=commit;h=9878d173f574df74bde0ff50b2f81009fbee81bb
vmxnet3: validate queues configuration coming from guest CVE-2013-4544 Signed-off-by: Dmitry Fleytman <dmitry@daynix.com> Reported-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-id: 1396604722-11902-3-git-send-email-dmitry@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1
static void vmxnet3_activate_device(VMXNET3State *s) { int i; static const uint32_t VMXNET3_DEF_TX_THRESHOLD = 1; hwaddr qdescr_table_pa; uint64_t pa; uint32_t size; /* Verify configuration consistency */ if (!vmxnet3_verify_driver_magic(s->drv_shmem)) { VMW_ERPRN("Device configuration received from driver is invalid"); return; } vmxnet3_adjust_by_guest_type(s); vmxnet3_update_features(s); vmxnet3_update_pm_state(s); vmxnet3_setup_rx_filtering(s); /* Cache fields from shared memory */ s->mtu = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.misc.mtu); VMW_CFPRN("MTU is %u", s->mtu); s->max_rx_frags = VMXNET3_READ_DRV_SHARED16(s->drv_shmem, devRead.misc.maxNumRxSG); if (s->max_rx_frags == 0) { s->max_rx_frags = 1; } VMW_CFPRN("Max RX fragments is %u", s->max_rx_frags); s->event_int_idx = VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.intrConf.eventIntrIdx); assert(vmxnet3_verify_intx(s, s->event_int_idx)); VMW_CFPRN("Events interrupt line is %u", s->event_int_idx); s->auto_int_masking = VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.intrConf.autoMask); VMW_CFPRN("Automatic interrupt masking is %d", (int)s->auto_int_masking); s->txq_num = VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.misc.numTxQueues); s->rxq_num = VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.misc.numRxQueues); VMW_CFPRN("Number of TX/RX queues %u/%u", s->txq_num, s->rxq_num); assert(s->txq_num <= VMXNET3_DEVICE_MAX_TX_QUEUES); qdescr_table_pa = VMXNET3_READ_DRV_SHARED64(s->drv_shmem, devRead.misc.queueDescPA); VMW_CFPRN("TX queues descriptors table is at 0x%" PRIx64, qdescr_table_pa); /* * Worst-case scenario is a packet that holds all TX rings space so * we calculate total size of all TX rings for max TX fragments number */ s->max_tx_frags = 0; /* TX queues */ for (i = 0; i < s->txq_num; i++) { hwaddr qdescr_pa = qdescr_table_pa + i * sizeof(struct Vmxnet3_TxQueueDesc); /* Read interrupt number for this TX queue */ s->txq_descr[i].intr_idx = VMXNET3_READ_TX_QUEUE_DESCR8(qdescr_pa, conf.intrIdx); assert(vmxnet3_verify_intx(s, s->txq_descr[i].intr_idx)); VMW_CFPRN("TX Queue %d interrupt: %d", i, s->txq_descr[i].intr_idx); /* Read rings memory locations for TX queues */ pa = VMXNET3_READ_TX_QUEUE_DESCR64(qdescr_pa, conf.txRingBasePA); size = VMXNET3_READ_TX_QUEUE_DESCR32(qdescr_pa, conf.txRingSize); vmxnet3_ring_init(&s->txq_descr[i].tx_ring, pa, size, sizeof(struct Vmxnet3_TxDesc), false); VMXNET3_RING_DUMP(VMW_CFPRN, "TX", i, &s->txq_descr[i].tx_ring); s->max_tx_frags += size; /* TXC ring */ pa = VMXNET3_READ_TX_QUEUE_DESCR64(qdescr_pa, conf.compRingBasePA); size = VMXNET3_READ_TX_QUEUE_DESCR32(qdescr_pa, conf.compRingSize); vmxnet3_ring_init(&s->txq_descr[i].comp_ring, pa, size, sizeof(struct Vmxnet3_TxCompDesc), true); VMXNET3_RING_DUMP(VMW_CFPRN, "TXC", i, &s->txq_descr[i].comp_ring); s->txq_descr[i].tx_stats_pa = qdescr_pa + offsetof(struct Vmxnet3_TxQueueDesc, stats); memset(&s->txq_descr[i].txq_stats, 0, sizeof(s->txq_descr[i].txq_stats)); /* Fill device-managed parameters for queues */ VMXNET3_WRITE_TX_QUEUE_DESCR32(qdescr_pa, ctrl.txThreshold, VMXNET3_DEF_TX_THRESHOLD); } /* Preallocate TX packet wrapper */ VMW_CFPRN("Max TX fragments is %u", s->max_tx_frags); vmxnet_tx_pkt_init(&s->tx_pkt, s->max_tx_frags, s->peer_has_vhdr); vmxnet_rx_pkt_init(&s->rx_pkt, s->peer_has_vhdr); /* Read rings memory locations for RX queues */ for (i = 0; i < s->rxq_num; i++) { int j; hwaddr qd_pa = qdescr_table_pa + s->txq_num * sizeof(struct Vmxnet3_TxQueueDesc) + i * sizeof(struct Vmxnet3_RxQueueDesc); /* Read interrupt number for this RX queue */ s->rxq_descr[i].intr_idx = VMXNET3_READ_TX_QUEUE_DESCR8(qd_pa, conf.intrIdx); assert(vmxnet3_verify_intx(s, s->rxq_descr[i].intr_idx)); VMW_CFPRN("RX Queue %d interrupt: %d", i, s->rxq_descr[i].intr_idx); /* Read rings memory locations */ for (j = 0; j < VMXNET3_RX_RINGS_PER_QUEUE; j++) { /* RX rings */ pa = VMXNET3_READ_RX_QUEUE_DESCR64(qd_pa, conf.rxRingBasePA[j]); size = VMXNET3_READ_RX_QUEUE_DESCR32(qd_pa, conf.rxRingSize[j]); vmxnet3_ring_init(&s->rxq_descr[i].rx_ring[j], pa, size, sizeof(struct Vmxnet3_RxDesc), false); VMW_CFPRN("RX queue %d:%d: Base: %" PRIx64 ", Size: %d", i, j, pa, size); } /* RXC ring */ pa = VMXNET3_READ_RX_QUEUE_DESCR64(qd_pa, conf.compRingBasePA); size = VMXNET3_READ_RX_QUEUE_DESCR32(qd_pa, conf.compRingSize); vmxnet3_ring_init(&s->rxq_descr[i].comp_ring, pa, size, sizeof(struct Vmxnet3_RxCompDesc), true); VMW_CFPRN("RXC queue %d: Base: %" PRIx64 ", Size: %d", i, pa, size); s->rxq_descr[i].rx_stats_pa = qd_pa + offsetof(struct Vmxnet3_RxQueueDesc, stats); memset(&s->rxq_descr[i].rxq_stats, 0, sizeof(s->rxq_descr[i].rxq_stats)); } vmxnet3_validate_interrupts(s); /* Make sure everything is in place before device activation */ smp_wmb(); vmxnet3_reset_mac(s); s->device_active = true; }
249,334,075,610,751,950,000,000,000,000,000,000,000
vmxnet3.c
216,873,920,930,645,670,000,000,000,000,000,000,000
[ "CWE-20" ]
CVE-2013-4544
hw/net/vmxnet3.c in QEMU 2.0.0-rc0, 1.7.1, and earlier allows local guest users to cause a denial of service or possibly execute arbitrary code via vectors related to (1) RX or (2) TX queue numbers or (3) interrupt indices. NOTE: some of these details are obtained from third party information.
https://nvd.nist.gov/vuln/detail/CVE-2013-4544
10,836
Little-CMS
5ca71a7bc18b6897ab21d815d15e218e204581e2
https://github.com/mm2/Little-CMS
https://github.com/mm2/Little-CMS/commit/5ca71a7bc18b6897ab21d815d15e218e204581e2
Added an extra check to MLU bounds Thanks to Ibrahim el-sayed for spotting the bug
1
void *Type_MLU_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag) { cmsMLU* mlu; cmsUInt32Number Count, RecLen, NumOfWchar; cmsUInt32Number SizeOfHeader; cmsUInt32Number Len, Offset; cmsUInt32Number i; wchar_t* Block; cmsUInt32Number BeginOfThisString, EndOfThisString, LargestPosition; *nItems = 0; if (!_cmsReadUInt32Number(io, &Count)) return NULL; if (!_cmsReadUInt32Number(io, &RecLen)) return NULL; if (RecLen != 12) { cmsSignalError(self->ContextID, cmsERROR_UNKNOWN_EXTENSION, "multiLocalizedUnicodeType of len != 12 is not supported."); return NULL; } mlu = cmsMLUalloc(self ->ContextID, Count); if (mlu == NULL) return NULL; mlu ->UsedEntries = Count; SizeOfHeader = 12 * Count + sizeof(_cmsTagBase); LargestPosition = 0; for (i=0; i < Count; i++) { if (!_cmsReadUInt16Number(io, &mlu ->Entries[i].Language)) goto Error; if (!_cmsReadUInt16Number(io, &mlu ->Entries[i].Country)) goto Error; // Now deal with Len and offset. if (!_cmsReadUInt32Number(io, &Len)) goto Error; if (!_cmsReadUInt32Number(io, &Offset)) goto Error; // Check for overflow if (Offset < (SizeOfHeader + 8)) goto Error; // True begin of the string BeginOfThisString = Offset - SizeOfHeader - 8; // Ajust to wchar_t elements mlu ->Entries[i].Len = (Len * sizeof(wchar_t)) / sizeof(cmsUInt16Number); mlu ->Entries[i].StrW = (BeginOfThisString * sizeof(wchar_t)) / sizeof(cmsUInt16Number); // To guess maximum size, add offset + len EndOfThisString = BeginOfThisString + Len; if (EndOfThisString > LargestPosition) LargestPosition = EndOfThisString; } // Now read the remaining of tag and fill all strings. Subtract the directory SizeOfTag = (LargestPosition * sizeof(wchar_t)) / sizeof(cmsUInt16Number); if (SizeOfTag == 0) { Block = NULL; NumOfWchar = 0; } else { Block = (wchar_t*) _cmsMalloc(self ->ContextID, SizeOfTag); if (Block == NULL) goto Error; NumOfWchar = SizeOfTag / sizeof(wchar_t); if (!_cmsReadWCharArray(io, NumOfWchar, Block)) goto Error; } mlu ->MemPool = Block; mlu ->PoolSize = SizeOfTag; mlu ->PoolUsed = SizeOfTag; *nItems = 1; return (void*) mlu; Error: if (mlu) cmsMLUfree(mlu); return NULL; }
11,487,822,218,315,490,000,000,000,000,000,000,000
cmstypes.c
132,058,870,710,618,560,000,000,000,000,000,000,000
[ "CWE-125" ]
CVE-2016-10165
The Type_MLU_Read function in cmstypes.c in Little CMS (aka lcms2) allows remote attackers to obtain sensitive information or cause a denial of service via an image with a crafted ICC profile, which triggers an out-of-bounds heap read.
https://nvd.nist.gov/vuln/detail/CVE-2016-10165
10,837
WavPack
26cb47f99d481ad9b93eeff80d26e6b63bbd7e15
https://github.com/dbry/WavPack
https://github.com/dbry/WavPack/commit/26cb47f99d481ad9b93eeff80d26e6b63bbd7e15
issue #30 issue #31 issue #32: no multiple format chunks in WAV or W64
1
int ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int64_t total_samples = 0, infilesize; Wave64ChunkHeader chunk_header; Wave64FileHeader filehdr; WaveHeader WaveHeader; uint32_t bcount; infilesize = DoGetFileSize (infile); memcpy (&filehdr, fourcc, 4); if (!DoReadFile (infile, ((char *) &filehdr) + 4, sizeof (Wave64FileHeader) - 4, &bcount) || bcount != sizeof (Wave64FileHeader) - 4 || memcmp (filehdr.ckID, riff_guid, sizeof (riff_guid)) || memcmp (filehdr.formType, wave_guid, sizeof (wave_guid))) { error_line ("%s is not a valid .W64 file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &filehdr, sizeof (filehdr))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } #if 1 // this might be a little too picky... WavpackLittleEndianToNative (&filehdr, Wave64ChunkHeaderFormat); if (infilesize && !(config->qmode & QMODE_IGNORE_LENGTH) && filehdr.ckSize && filehdr.ckSize + 1 && filehdr.ckSize != infilesize) { error_line ("%s is not a valid .W64 file!", infilename); return WAVPACK_SOFT_ERROR; } #endif // loop through all elements of the wave64 header // (until the data chuck) and copy them to the output file while (1) { if (!DoReadFile (infile, &chunk_header, sizeof (Wave64ChunkHeader), &bcount) || bcount != sizeof (Wave64ChunkHeader)) { error_line ("%s is not a valid .W64 file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &chunk_header, sizeof (Wave64ChunkHeader))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackLittleEndianToNative (&chunk_header, Wave64ChunkHeaderFormat); chunk_header.ckSize -= sizeof (chunk_header); // if it's the format chunk, we want to get some info out of there and // make sure it's a .wav file we can handle if (!memcmp (chunk_header.ckID, fmt_guid, sizeof (fmt_guid))) { int supported = TRUE, format; chunk_header.ckSize = (chunk_header.ckSize + 7) & ~7L; if (chunk_header.ckSize < 16 || chunk_header.ckSize > sizeof (WaveHeader) || !DoReadFile (infile, &WaveHeader, (uint32_t) chunk_header.ckSize, &bcount) || bcount != chunk_header.ckSize) { error_line ("%s is not a valid .W64 file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &WaveHeader, (uint32_t) chunk_header.ckSize)) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackLittleEndianToNative (&WaveHeader, WaveHeaderFormat); if (debug_logging_mode) { error_line ("format tag size = %d", chunk_header.ckSize); error_line ("FormatTag = %x, NumChannels = %d, BitsPerSample = %d", WaveHeader.FormatTag, WaveHeader.NumChannels, WaveHeader.BitsPerSample); error_line ("BlockAlign = %d, SampleRate = %d, BytesPerSecond = %d", WaveHeader.BlockAlign, WaveHeader.SampleRate, WaveHeader.BytesPerSecond); if (chunk_header.ckSize > 16) error_line ("cbSize = %d, ValidBitsPerSample = %d", WaveHeader.cbSize, WaveHeader.ValidBitsPerSample); if (chunk_header.ckSize > 20) error_line ("ChannelMask = %x, SubFormat = %d", WaveHeader.ChannelMask, WaveHeader.SubFormat); } if (chunk_header.ckSize > 16 && WaveHeader.cbSize == 2) config->qmode |= QMODE_ADOBE_MODE; format = (WaveHeader.FormatTag == 0xfffe && chunk_header.ckSize == 40) ? WaveHeader.SubFormat : WaveHeader.FormatTag; config->bits_per_sample = (chunk_header.ckSize == 40 && WaveHeader.ValidBitsPerSample) ? WaveHeader.ValidBitsPerSample : WaveHeader.BitsPerSample; if (format != 1 && format != 3) supported = FALSE; if (format == 3 && config->bits_per_sample != 32) supported = FALSE; if (!WaveHeader.NumChannels || WaveHeader.NumChannels > 256 || WaveHeader.BlockAlign / WaveHeader.NumChannels < (config->bits_per_sample + 7) / 8 || WaveHeader.BlockAlign / WaveHeader.NumChannels > 4 || WaveHeader.BlockAlign % WaveHeader.NumChannels) supported = FALSE; if (config->bits_per_sample < 1 || config->bits_per_sample > 32) supported = FALSE; if (!supported) { error_line ("%s is an unsupported .W64 format!", infilename); return WAVPACK_SOFT_ERROR; } if (chunk_header.ckSize < 40) { if (!config->channel_mask && !(config->qmode & QMODE_CHANS_UNASSIGNED)) { if (WaveHeader.NumChannels <= 2) config->channel_mask = 0x5 - WaveHeader.NumChannels; else if (WaveHeader.NumChannels <= 18) config->channel_mask = (1 << WaveHeader.NumChannels) - 1; else config->channel_mask = 0x3ffff; } } else if (WaveHeader.ChannelMask && (config->channel_mask || (config->qmode & QMODE_CHANS_UNASSIGNED))) { error_line ("this W64 file already has channel order information!"); return WAVPACK_SOFT_ERROR; } else if (WaveHeader.ChannelMask) config->channel_mask = WaveHeader.ChannelMask; if (format == 3) config->float_norm_exp = 127; else if ((config->qmode & QMODE_ADOBE_MODE) && WaveHeader.BlockAlign / WaveHeader.NumChannels == 4) { if (WaveHeader.BitsPerSample == 24) config->float_norm_exp = 127 + 23; else if (WaveHeader.BitsPerSample == 32) config->float_norm_exp = 127 + 15; } if (debug_logging_mode) { if (config->float_norm_exp == 127) error_line ("data format: normalized 32-bit floating point"); else error_line ("data format: %d-bit integers stored in %d byte(s)", config->bits_per_sample, WaveHeader.BlockAlign / WaveHeader.NumChannels); } } else if (!memcmp (chunk_header.ckID, data_guid, sizeof (data_guid))) { // on the data chunk, get size and exit loop if (!WaveHeader.NumChannels) { // make sure we saw "fmt" chunk error_line ("%s is not a valid .W64 file!", infilename); return WAVPACK_SOFT_ERROR; } if ((config->qmode & QMODE_IGNORE_LENGTH) || chunk_header.ckSize <= 0) { config->qmode |= QMODE_IGNORE_LENGTH; if (infilesize && DoGetFilePosition (infile) != -1) total_samples = (infilesize - DoGetFilePosition (infile)) / WaveHeader.BlockAlign; else total_samples = -1; } else { if (infilesize && infilesize - chunk_header.ckSize > 16777216) { error_line ("this .W64 file has over 16 MB of extra RIFF data, probably is corrupt!"); return WAVPACK_SOFT_ERROR; } total_samples = chunk_header.ckSize / WaveHeader.BlockAlign; if (!total_samples) { error_line ("this .W64 file has no audio samples, probably is corrupt!"); return WAVPACK_SOFT_ERROR; } if (total_samples > MAX_WAVPACK_SAMPLES) { error_line ("%s has too many samples for WavPack!", infilename); return WAVPACK_SOFT_ERROR; } } config->bytes_per_sample = WaveHeader.BlockAlign / WaveHeader.NumChannels; config->num_channels = WaveHeader.NumChannels; config->sample_rate = WaveHeader.SampleRate; break; } else { // just copy unknown chunks to output file int bytes_to_copy = (chunk_header.ckSize + 7) & ~7L; char *buff; if (bytes_to_copy < 0 || bytes_to_copy > 4194304) { error_line ("%s is not a valid .W64 file!", infilename); return WAVPACK_SOFT_ERROR; } buff = malloc (bytes_to_copy); if (debug_logging_mode) error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", chunk_header.ckID [0], chunk_header.ckID [1], chunk_header.ckID [2], chunk_header.ckID [3], chunk_header.ckSize); if (!DoReadFile (infile, buff, bytes_to_copy, &bcount) || bcount != bytes_to_copy || (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, buff, bytes_to_copy))) { error_line ("%s", WavpackGetErrorMessage (wpc)); free (buff); return WAVPACK_SOFT_ERROR; } free (buff); } } if (!WavpackSetConfiguration64 (wpc, config, total_samples, NULL)) { error_line ("%s: %s", infilename, WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } return WAVPACK_NO_ERROR; }
52,732,810,850,628,605,000,000,000,000,000,000,000
wave64.c
80,250,037,771,172,160,000,000,000,000,000,000,000
[ "CWE-119" ]
CVE-2018-10537
An issue was discovered in WavPack 5.1.0 and earlier. The W64 parser component contains a vulnerability that allows writing to memory because ParseWave64HeaderConfig in wave64.c does not reject multiple format chunks.
https://nvd.nist.gov/vuln/detail/CVE-2018-10537
10,838
WavPack
26cb47f99d481ad9b93eeff80d26e6b63bbd7e15
https://github.com/dbry/WavPack
https://github.com/dbry/WavPack/commit/26cb47f99d481ad9b93eeff80d26e6b63bbd7e15
issue #30 issue #31 issue #32: no multiple format chunks in WAV or W64
1
int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int is_rf64 = !strncmp (fourcc, "RF64", 4), got_ds64 = 0; int64_t total_samples = 0, infilesize; RiffChunkHeader riff_chunk_header; ChunkHeader chunk_header; WaveHeader WaveHeader; DS64Chunk ds64_chunk; uint32_t bcount; CLEAR (WaveHeader); CLEAR (ds64_chunk); infilesize = DoGetFileSize (infile); if (!is_rf64 && infilesize >= 4294967296LL && !(config->qmode & QMODE_IGNORE_LENGTH)) { error_line ("can't handle .WAV files larger than 4 GB (non-standard)!"); return WAVPACK_SOFT_ERROR; } memcpy (&riff_chunk_header, fourcc, 4); if ((!DoReadFile (infile, ((char *) &riff_chunk_header) + 4, sizeof (RiffChunkHeader) - 4, &bcount) || bcount != sizeof (RiffChunkHeader) - 4 || strncmp (riff_chunk_header.formType, "WAVE", 4))) { error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &riff_chunk_header, sizeof (RiffChunkHeader))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } // loop through all elements of the RIFF wav header // (until the data chuck) and copy them to the output file while (1) { if (!DoReadFile (infile, &chunk_header, sizeof (ChunkHeader), &bcount) || bcount != sizeof (ChunkHeader)) { error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &chunk_header, sizeof (ChunkHeader))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackLittleEndianToNative (&chunk_header, ChunkHeaderFormat); if (!strncmp (chunk_header.ckID, "ds64", 4)) { if (chunk_header.ckSize < sizeof (DS64Chunk) || !DoReadFile (infile, &ds64_chunk, sizeof (DS64Chunk), &bcount) || bcount != sizeof (DS64Chunk)) { error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &ds64_chunk, sizeof (DS64Chunk))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } got_ds64 = 1; WavpackLittleEndianToNative (&ds64_chunk, DS64ChunkFormat); if (debug_logging_mode) error_line ("DS64: riffSize = %lld, dataSize = %lld, sampleCount = %lld, table_length = %d", (long long) ds64_chunk.riffSize64, (long long) ds64_chunk.dataSize64, (long long) ds64_chunk.sampleCount64, ds64_chunk.tableLength); if (ds64_chunk.tableLength * sizeof (CS64Chunk) != chunk_header.ckSize - sizeof (DS64Chunk)) { error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } while (ds64_chunk.tableLength--) { CS64Chunk cs64_chunk; if (!DoReadFile (infile, &cs64_chunk, sizeof (CS64Chunk), &bcount) || bcount != sizeof (CS64Chunk) || (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &cs64_chunk, sizeof (CS64Chunk)))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } } } else if (!strncmp (chunk_header.ckID, "fmt ", 4)) { // if it's the format chunk, we want to get some info out of there and int supported = TRUE, format; // make sure it's a .wav file we can handle if (chunk_header.ckSize < 16 || chunk_header.ckSize > sizeof (WaveHeader) || !DoReadFile (infile, &WaveHeader, chunk_header.ckSize, &bcount) || bcount != chunk_header.ckSize) { error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &WaveHeader, chunk_header.ckSize)) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackLittleEndianToNative (&WaveHeader, WaveHeaderFormat); if (debug_logging_mode) { error_line ("format tag size = %d", chunk_header.ckSize); error_line ("FormatTag = %x, NumChannels = %d, BitsPerSample = %d", WaveHeader.FormatTag, WaveHeader.NumChannels, WaveHeader.BitsPerSample); error_line ("BlockAlign = %d, SampleRate = %d, BytesPerSecond = %d", WaveHeader.BlockAlign, WaveHeader.SampleRate, WaveHeader.BytesPerSecond); if (chunk_header.ckSize > 16) error_line ("cbSize = %d, ValidBitsPerSample = %d", WaveHeader.cbSize, WaveHeader.ValidBitsPerSample); if (chunk_header.ckSize > 20) error_line ("ChannelMask = %x, SubFormat = %d", WaveHeader.ChannelMask, WaveHeader.SubFormat); } if (chunk_header.ckSize > 16 && WaveHeader.cbSize == 2) config->qmode |= QMODE_ADOBE_MODE; format = (WaveHeader.FormatTag == 0xfffe && chunk_header.ckSize == 40) ? WaveHeader.SubFormat : WaveHeader.FormatTag; config->bits_per_sample = (chunk_header.ckSize == 40 && WaveHeader.ValidBitsPerSample) ? WaveHeader.ValidBitsPerSample : WaveHeader.BitsPerSample; if (format != 1 && format != 3) supported = FALSE; if (format == 3 && config->bits_per_sample != 32) supported = FALSE; if (!WaveHeader.NumChannels || WaveHeader.NumChannels > 256 || WaveHeader.BlockAlign / WaveHeader.NumChannels < (config->bits_per_sample + 7) / 8 || WaveHeader.BlockAlign / WaveHeader.NumChannels > 4 || WaveHeader.BlockAlign % WaveHeader.NumChannels) supported = FALSE; if (config->bits_per_sample < 1 || config->bits_per_sample > 32) supported = FALSE; if (!supported) { error_line ("%s is an unsupported .WAV format!", infilename); return WAVPACK_SOFT_ERROR; } if (chunk_header.ckSize < 40) { if (!config->channel_mask && !(config->qmode & QMODE_CHANS_UNASSIGNED)) { if (WaveHeader.NumChannels <= 2) config->channel_mask = 0x5 - WaveHeader.NumChannels; else if (WaveHeader.NumChannels <= 18) config->channel_mask = (1 << WaveHeader.NumChannels) - 1; else config->channel_mask = 0x3ffff; } } else if (WaveHeader.ChannelMask && (config->channel_mask || (config->qmode & QMODE_CHANS_UNASSIGNED))) { error_line ("this WAV file already has channel order information!"); return WAVPACK_SOFT_ERROR; } else if (WaveHeader.ChannelMask) config->channel_mask = WaveHeader.ChannelMask; if (format == 3) config->float_norm_exp = 127; else if ((config->qmode & QMODE_ADOBE_MODE) && WaveHeader.BlockAlign / WaveHeader.NumChannels == 4) { if (WaveHeader.BitsPerSample == 24) config->float_norm_exp = 127 + 23; else if (WaveHeader.BitsPerSample == 32) config->float_norm_exp = 127 + 15; } if (debug_logging_mode) { if (config->float_norm_exp == 127) error_line ("data format: normalized 32-bit floating point"); else if (config->float_norm_exp) error_line ("data format: 32-bit floating point (Audition %d:%d float type 1)", config->float_norm_exp - 126, 150 - config->float_norm_exp); else error_line ("data format: %d-bit integers stored in %d byte(s)", config->bits_per_sample, WaveHeader.BlockAlign / WaveHeader.NumChannels); } } else if (!strncmp (chunk_header.ckID, "data", 4)) { // on the data chunk, get size and exit loop int64_t data_chunk_size = (got_ds64 && chunk_header.ckSize == (uint32_t) -1) ? ds64_chunk.dataSize64 : chunk_header.ckSize; if (!WaveHeader.NumChannels || (is_rf64 && !got_ds64)) { // make sure we saw "fmt" and "ds64" chunks (if required) error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } if (infilesize && !(config->qmode & QMODE_IGNORE_LENGTH) && infilesize - data_chunk_size > 16777216) { error_line ("this .WAV file has over 16 MB of extra RIFF data, probably is corrupt!"); return WAVPACK_SOFT_ERROR; } if (config->qmode & QMODE_IGNORE_LENGTH) { if (infilesize && DoGetFilePosition (infile) != -1) total_samples = (infilesize - DoGetFilePosition (infile)) / WaveHeader.BlockAlign; else total_samples = -1; } else { total_samples = data_chunk_size / WaveHeader.BlockAlign; if (got_ds64 && total_samples != ds64_chunk.sampleCount64) { error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } if (!total_samples) { error_line ("this .WAV file has no audio samples, probably is corrupt!"); return WAVPACK_SOFT_ERROR; } if (total_samples > MAX_WAVPACK_SAMPLES) { error_line ("%s has too many samples for WavPack!", infilename); return WAVPACK_SOFT_ERROR; } } config->bytes_per_sample = WaveHeader.BlockAlign / WaveHeader.NumChannels; config->num_channels = WaveHeader.NumChannels; config->sample_rate = WaveHeader.SampleRate; break; } else { // just copy unknown chunks to output file int bytes_to_copy = (chunk_header.ckSize + 1) & ~1L; char *buff; if (bytes_to_copy < 0 || bytes_to_copy > 4194304) { error_line ("%s is not a valid .WAV file!", infilename); return WAVPACK_SOFT_ERROR; } buff = malloc (bytes_to_copy); if (debug_logging_mode) error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", chunk_header.ckID [0], chunk_header.ckID [1], chunk_header.ckID [2], chunk_header.ckID [3], chunk_header.ckSize); if (!DoReadFile (infile, buff, bytes_to_copy, &bcount) || bcount != bytes_to_copy || (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, buff, bytes_to_copy))) { error_line ("%s", WavpackGetErrorMessage (wpc)); free (buff); return WAVPACK_SOFT_ERROR; } free (buff); } } if (!WavpackSetConfiguration64 (wpc, config, total_samples, NULL)) { error_line ("%s: %s", infilename, WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } return WAVPACK_NO_ERROR; }
152,045,847,845,484,900,000,000,000,000,000,000,000
riff.c
29,803,808,998,334,980,000,000,000,000,000,000,000
[ "CWE-119" ]
CVE-2018-10537
An issue was discovered in WavPack 5.1.0 and earlier. The W64 parser component contains a vulnerability that allows writing to memory because ParseWave64HeaderConfig in wave64.c does not reject multiple format chunks.
https://nvd.nist.gov/vuln/detail/CVE-2018-10537
10,839
FFmpeg
95556e27e2c1d56d9e18f5db34d6f756f3011148
https://github.com/FFmpeg/FFmpeg
https://github.com/FFmpeg/FFmpeg/commit/95556e27e2c1d56d9e18f5db34d6f756f3011148
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 <michael@niedermayer.cc>
1
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; }
194,781,423,137,917,070,000,000,000,000,000,000,000
movenc.c
128,083,843,490,396,450,000,000,000,000,000,000,000
[ "CWE-125" ]
CVE-2018-13300
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.
https://nvd.nist.gov/vuln/detail/CVE-2018-13300
10,841
dbus
954d75b2b64e4799f360d2a6bf9cff6d9fee37e7
http://gitweb.freedesktop.org/?p=dbus/dbus
https://cgit.freedesktop.org/dbus/dbus/commit/?id=954d75b2b64e4799f360d2a6bf9cff6d9fee37e7
CVE-2013-2168: _dbus_printf_string_upper_bound: copy the va_list for each use Using a va_list more than once is non-portable: it happens to work under the ABI of (for instance) x86 Linux, but not x86-64 Linux. This led to _dbus_printf_string_upper_bound() crashing if it should have returned exactly 1024 bytes. Many system services can be induced to process a caller-controlled string in ways that end up using _dbus_printf_string_upper_bound(), so this is a denial of service. Reviewed-by: Thiago Macieira <thiago@kde.org>
1
_dbus_printf_string_upper_bound (const char *format, va_list args) { char static_buf[1024]; int bufsize = sizeof (static_buf); int len; len = vsnprintf (static_buf, bufsize, format, args); /* If vsnprintf() returned non-negative, then either the string fits in * static_buf, or this OS has the POSIX and C99 behaviour where vsnprintf * returns the number of characters that were needed, or this OS returns the * truncated length. * * We ignore the possibility that snprintf might just ignore the length and * overrun the buffer (64-bit Solaris 7), because that's pathological. * If your libc is really that bad, come back when you have a better one. */ if (len == bufsize) { /* This could be the truncated length (Tru64 and IRIX have this bug), * or the real length could be coincidentally the same. Which is it? * If vsnprintf returns the truncated length, we'll go to the slow * path. */ if (vsnprintf (static_buf, 1, format, args) == 1) len = -1; } /* If vsnprintf() returned negative, we have to do more work. * HP-UX returns negative. */ while (len < 0) { char *buf; bufsize *= 2; buf = dbus_malloc (bufsize); if (buf == NULL) return -1; len = vsnprintf (buf, bufsize, format, args); dbus_free (buf); /* If the reported length is exactly the buffer size, round up to the * next size, in case vsnprintf has been returning the truncated * length */ if (len == bufsize) len = -1; } return len; }
222,824,617,731,331,620,000,000,000,000,000,000,000
dbus-sysdeps-unix.c
236,569,366,045,276,130,000,000,000,000,000,000,000
[ "CWE-20" ]
CVE-2013-2168
The _dbus_printf_string_upper_bound function in dbus/dbus-sysdeps-unix.c in D-Bus (aka DBus) 1.4.x before 1.4.26, 1.6.x before 1.6.12, and 1.7.x before 1.7.4 allows local users to cause a denial of service (service crash) via a crafted message.
https://nvd.nist.gov/vuln/detail/CVE-2013-2168
10,842
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static bool check_rodc_critical_attribute(struct ldb_message *msg) { uint32_t schemaFlagsEx, searchFlags, rodc_filtered_flags; schemaFlagsEx = ldb_msg_find_attr_as_uint(msg, "schemaFlagsEx", 0); searchFlags = ldb_msg_find_attr_as_uint(msg, "searchFlags", 0); rodc_filtered_flags = (SEARCH_FLAG_RODC_ATTRIBUTE | SEARCH_FLAG_CONFIDENTIAL); if ((schemaFlagsEx & SCHEMA_FLAG_ATTR_IS_CRITICAL) && ((searchFlags & rodc_filtered_flags) == rodc_filtered_flags)) { return true; } else { return false; } }
205,557,571,549,339,770,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,843
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_add_entry(struct samldb_ctx *ac) { struct ldb_context *ldb; struct ldb_request *req; int ret; ldb = ldb_module_get_ctx(ac->module); ret = ldb_build_add_req(&req, ldb, ac, ac->msg, ac->req->controls, ac, samldb_add_entry_callback, ac->req); LDB_REQ_SET_LOCATION(req); if (ret != LDB_SUCCESS) { return ret; } return ldb_next_request(ac->module, req); }
204,994,596,923,949,140,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,844
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_add_entry_callback(struct ldb_request *req, struct ldb_reply *ares) { struct ldb_context *ldb; struct samldb_ctx *ac; int ret; ac = talloc_get_type(req->context, struct samldb_ctx); ldb = ldb_module_get_ctx(ac->module); if (!ares) { return ldb_module_done(ac->req, NULL, NULL, LDB_ERR_OPERATIONS_ERROR); } if (ares->type == LDB_REPLY_REFERRAL) { return ldb_module_send_referral(ac->req, ares->referral); } if (ares->error != LDB_SUCCESS) { return ldb_module_done(ac->req, ares->controls, ares->response, ares->error); } if (ares->type != LDB_REPLY_DONE) { ldb_asprintf_errstring(ldb, "Invalid LDB reply type %d", ares->type); return ldb_module_done(ac->req, NULL, NULL, LDB_ERR_OPERATIONS_ERROR); } /* The caller may wish to get controls back from the add */ ac->ares = talloc_steal(ac, ares); ret = samldb_next_step(ac); if (ret != LDB_SUCCESS) { return ldb_module_done(ac->req, NULL, NULL, ret); } return ret; }
79,521,508,164,134,765,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,845
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac) { int ret; bool id_exists; uint32_t msds_intid; int32_t system_flags; struct ldb_context *ldb; struct ldb_result *ldb_res; struct ldb_dn *schema_dn; struct samldb_msds_intid_persistant *msds_intid_struct; struct dsdb_schema *schema; ldb = ldb_module_get_ctx(ac->module); schema_dn = ldb_get_schema_basedn(ldb); /* replicated update should always go through */ if (ldb_request_get_control(ac->req, DSDB_CONTROL_REPLICATED_UPDATE_OID)) { return LDB_SUCCESS; } /* msDS-IntId is handled by system and should never be * passed by clients */ if (ldb_msg_find_element(ac->msg, "msDS-IntId")) { return LDB_ERR_UNWILLING_TO_PERFORM; } /* do not generate msDS-IntId if Relax control is passed */ if (ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID)) { return LDB_SUCCESS; } /* check Functional Level */ if (dsdb_functional_level(ldb) < DS_DOMAIN_FUNCTION_2003) { return LDB_SUCCESS; } /* check systemFlags for SCHEMA_BASE_OBJECT flag */ system_flags = ldb_msg_find_attr_as_int(ac->msg, "systemFlags", 0); if (system_flags & SYSTEM_FLAG_SCHEMA_BASE_OBJECT) { return LDB_SUCCESS; } schema = dsdb_get_schema(ldb, NULL); if (!schema) { ldb_debug_set(ldb, LDB_DEBUG_FATAL, "samldb_schema_info_update: no dsdb_schema loaded"); DEBUG(0,(__location__ ": %s\n", ldb_errstring(ldb))); return ldb_operr(ldb); } msds_intid_struct = (struct samldb_msds_intid_persistant*) ldb_get_opaque(ldb, SAMLDB_MSDS_INTID_OPAQUE); if (!msds_intid_struct) { msds_intid_struct = talloc(ldb, struct samldb_msds_intid_persistant); /* Generate new value for msDs-IntId * Value should be in 0x80000000..0xBFFFFFFF range */ msds_intid = generate_random() % 0X3FFFFFFF; msds_intid += 0x80000000; msds_intid_struct->msds_intid = msds_intid; msds_intid_struct->usn = schema->loaded_usn; DEBUG(2, ("No samldb_msds_intid_persistant struct, allocating a new one\n")); } else { msds_intid = msds_intid_struct->msds_intid; } /* probe id values until unique one is found */ do { uint64_t current_usn; msds_intid++; if (msds_intid > 0xBFFFFFFF) { msds_intid = 0x80000001; } /* * Alternative strategy to a costly (even indexed search) to the * database. * We search in the schema if we have already this intid (using dsdb_attribute_by_attributeID_id because * in the range 0x80000000 0xBFFFFFFFF, attributeID is a DSDB_ATTID_TYPE_INTID). * If so generate another random value. * If not check if the highest USN in the database for the schema partition is the * one that we know. * If so it means that's only this ldb context that is touching the schema in the database. * If not it means that's someone else has modified the database while we are doing our changes too * (this case should be very bery rare) in order to be sure do the search in the database. */ if (dsdb_attribute_by_attributeID_id(schema, msds_intid)) { msds_intid = generate_random() % 0X3FFFFFFF; msds_intid += 0x80000000; continue; } ret = dsdb_module_load_partition_usn(ac->module, schema_dn, &current_usn, NULL, NULL); if (ret != LDB_SUCCESS) { ldb_debug_set(ldb, LDB_DEBUG_ERROR, __location__": Searching for schema USN failed: %s\n", ldb_errstring(ldb)); return ldb_operr(ldb); } /* current_usn can be lesser than msds_intid_struct-> if there is * uncommited changes. */ if (current_usn > msds_intid_struct->usn) { /* oups something has changed, someone/something * else is modifying or has modified the schema * we'd better check this intid is the database directly */ DEBUG(2, ("Schema has changed, searching the database for the unicity of %d\n", msds_intid)); ret = dsdb_module_search(ac->module, ac, &ldb_res, schema_dn, LDB_SCOPE_ONELEVEL, NULL, DSDB_FLAG_NEXT_MODULE, ac->req, "(msDS-IntId=%d)", msds_intid); if (ret != LDB_SUCCESS) { ldb_debug_set(ldb, LDB_DEBUG_ERROR, __location__": Searching for msDS-IntId=%d failed - %s\n", msds_intid, ldb_errstring(ldb)); return ldb_operr(ldb); } id_exists = (ldb_res->count > 0); talloc_free(ldb_res); } else { id_exists = 0; } } while(id_exists); msds_intid_struct->msds_intid = msds_intid; ldb_set_opaque(ldb, SAMLDB_MSDS_INTID_OPAQUE, msds_intid_struct); return samdb_msg_add_int(ldb, ac->msg, ac->msg, "msDS-IntId", msds_intid); }
44,351,705,639,129,040,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,846
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_add_step(struct samldb_ctx *ac, samldb_step_fn_t fn) { struct samldb_step *step, *stepper; step = talloc_zero(ac, struct samldb_step); if (step == NULL) { return ldb_oom(ldb_module_get_ctx(ac->module)); } step->fn = fn; if (ac->steps == NULL) { ac->steps = step; ac->curstep = step; } else { if (ac->curstep == NULL) return ldb_operr(ldb_module_get_ctx(ac->module)); for (stepper = ac->curstep; stepper->next != NULL; stepper = stepper->next); stepper->next = step; } return LDB_SUCCESS; }
188,977,747,954,049,500,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,847
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_check_sAMAccountName(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); const char *name; int ret; struct ldb_result *res; const char * const noattrs[] = { NULL }; if (ldb_msg_find_element(ac->msg, "sAMAccountName") == NULL) { ret = samldb_generate_sAMAccountName(ldb, ac->msg); if (ret != LDB_SUCCESS) { return ret; } } name = ldb_msg_find_attr_as_string(ac->msg, "sAMAccountName", NULL); if (name == NULL) { /* The "sAMAccountName" cannot be nothing */ ldb_set_errstring(ldb, "samldb: Empty account names aren't allowed!"); return LDB_ERR_CONSTRAINT_VIOLATION; } ret = dsdb_module_search(ac->module, ac, &res, ldb_get_default_basedn(ldb), LDB_SCOPE_SUBTREE, noattrs, DSDB_FLAG_NEXT_MODULE, ac->req, "(sAMAccountName=%s)", ldb_binary_encode_string(ac, name)); if (ret != LDB_SUCCESS) { return ret; } if (res->count != 0) { ldb_asprintf_errstring(ldb, "samldb: Account name (sAMAccountName) '%s' already in use!", name); talloc_free(res); return LDB_ERR_ENTRY_ALREADY_EXISTS; } talloc_free(res); return samldb_next_step(ac); }
174,649,580,708,161,700,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,848
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_check_user_account_control_invariants(struct samldb_ctx *ac, uint32_t user_account_control) { int i, ret = 0; bool need_check = false; const struct uac_to_guid { uint32_t uac; bool never; uint32_t needs; uint32_t not_with; const char *error_string; } map[] = { { .uac = UF_TEMP_DUPLICATE_ACCOUNT, .never = true, .error_string = "Updating the UF_TEMP_DUPLICATE_ACCOUNT flag is never allowed" }, { .uac = UF_PARTIAL_SECRETS_ACCOUNT, .needs = UF_WORKSTATION_TRUST_ACCOUNT, .error_string = "Setting UF_PARTIAL_SECRETS_ACCOUNT only permitted with UF_WORKSTATION_TRUST_ACCOUNT" }, { .uac = UF_TRUSTED_FOR_DELEGATION, .not_with = UF_PARTIAL_SECRETS_ACCOUNT, .error_string = "Setting UF_TRUSTED_FOR_DELEGATION not allowed with UF_PARTIAL_SECRETS_ACCOUNT" }, { .uac = UF_NORMAL_ACCOUNT, .not_with = UF_ACCOUNT_TYPE_MASK & ~UF_NORMAL_ACCOUNT, .error_string = "Setting more than one account type not permitted" }, { .uac = UF_WORKSTATION_TRUST_ACCOUNT, .not_with = UF_ACCOUNT_TYPE_MASK & ~UF_WORKSTATION_TRUST_ACCOUNT, .error_string = "Setting more than one account type not permitted" }, { .uac = UF_INTERDOMAIN_TRUST_ACCOUNT, .not_with = UF_ACCOUNT_TYPE_MASK & ~UF_INTERDOMAIN_TRUST_ACCOUNT, .error_string = "Setting more than one account type not permitted" }, { .uac = UF_SERVER_TRUST_ACCOUNT, .not_with = UF_ACCOUNT_TYPE_MASK & ~UF_SERVER_TRUST_ACCOUNT, .error_string = "Setting more than one account type not permitted" }, { .uac = UF_TRUSTED_FOR_DELEGATION, .not_with = UF_PARTIAL_SECRETS_ACCOUNT, .error_string = "Setting UF_TRUSTED_FOR_DELEGATION not allowed with UF_PARTIAL_SECRETS_ACCOUNT" } }; for (i = 0; i < ARRAY_SIZE(map); i++) { if (user_account_control & map[i].uac) { need_check = true; break; } } if (need_check == false) { return LDB_SUCCESS; } for (i = 0; i < ARRAY_SIZE(map); i++) { uint32_t this_uac = user_account_control & map[i].uac; if (this_uac != 0) { if (map[i].never) { ret = LDB_ERR_OTHER; break; } else if (map[i].needs != 0) { if ((map[i].needs & user_account_control) == 0) { ret = LDB_ERR_OTHER; break; } } else if (map[i].not_with != 0) { if ((map[i].not_with & user_account_control) != 0) { ret = LDB_ERR_OTHER; break; } } } } if (ret != LDB_SUCCESS) { switch (ac->req->operation) { case LDB_ADD: ldb_asprintf_errstring(ldb_module_get_ctx(ac->module), "Failed to add %s: %s", ldb_dn_get_linearized(ac->msg->dn), map[i].error_string); break; case LDB_MODIFY: ldb_asprintf_errstring(ldb_module_get_ctx(ac->module), "Failed to modify %s: %s", ldb_dn_get_linearized(ac->msg->dn), map[i].error_string); break; default: return ldb_module_operr(ac->module); } } return ret; }
54,248,369,882,699,110,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,849
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static struct samldb_ctx *samldb_ctx_init(struct ldb_module *module, struct ldb_request *req) { struct ldb_context *ldb; struct samldb_ctx *ac; ldb = ldb_module_get_ctx(module); ac = talloc_zero(req, struct samldb_ctx); if (ac == NULL) { ldb_oom(ldb); return NULL; } ac->module = module; ac->req = req; return ac; }
33,409,164,939,998,820,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,850
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_fill_foreignSecurityPrincipal_object(struct samldb_ctx *ac) { struct ldb_context *ldb; const struct ldb_val *rdn_value; struct dom_sid *sid; int ret; ldb = ldb_module_get_ctx(ac->module); sid = samdb_result_dom_sid(ac->msg, ac->msg, "objectSid"); if (sid == NULL) { rdn_value = ldb_dn_get_rdn_val(ac->msg->dn); if (rdn_value == NULL) { return ldb_operr(ldb); } sid = dom_sid_parse_talloc(ac->msg, (const char *)rdn_value->data); if (sid == NULL) { ldb_set_errstring(ldb, "samldb: No valid SID found in ForeignSecurityPrincipal CN!"); return LDB_ERR_CONSTRAINT_VIOLATION; } if (! samldb_msg_add_sid(ac->msg, "objectSid", sid)) { return ldb_operr(ldb); } } /* finally proceed with adding the entry */ ret = samldb_add_step(ac, samldb_add_entry); if (ret != LDB_SUCCESS) return ret; return samldb_first_step(ac); }
64,065,653,880,728,030,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,851
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_fill_object(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); int ret; /* Add information for the different account types */ switch(ac->type) { case SAMLDB_TYPE_USER: { struct ldb_control *rodc_control = ldb_request_get_control(ac->req, LDB_CONTROL_RODC_DCPROMO_OID); if (rodc_control != NULL) { /* see [MS-ADTS] 3.1.1.3.4.1.23 LDAP_SERVER_RODC_DCPROMO_OID */ rodc_control->critical = false; ret = samldb_add_step(ac, samldb_rodc_add); if (ret != LDB_SUCCESS) return ret; } /* check if we have a valid sAMAccountName */ ret = samldb_add_step(ac, samldb_check_sAMAccountName); if (ret != LDB_SUCCESS) return ret; ret = samldb_add_step(ac, samldb_add_entry); if (ret != LDB_SUCCESS) return ret; break; } case SAMLDB_TYPE_GROUP: { /* check if we have a valid sAMAccountName */ ret = samldb_add_step(ac, samldb_check_sAMAccountName); if (ret != LDB_SUCCESS) return ret; ret = samldb_add_step(ac, samldb_add_entry); if (ret != LDB_SUCCESS) return ret; break; } case SAMLDB_TYPE_CLASS: { const struct ldb_val *rdn_value, *def_obj_cat_val; unsigned int v = ldb_msg_find_attr_as_uint(ac->msg, "objectClassCategory", -2); /* As discussed with Microsoft through dochelp in April 2012 this is the behavior of windows*/ if (!ldb_msg_find_element(ac->msg, "subClassOf")) { ret = ldb_msg_add_string(ac->msg, "subClassOf", "top"); if (ret != LDB_SUCCESS) return ret; } ret = samdb_find_or_add_attribute(ldb, ac->msg, "rdnAttId", "cn"); if (ret != LDB_SUCCESS) return ret; /* do not allow to mark an attributeSchema as RODC filtered if it * is system-critical */ if (check_rodc_critical_attribute(ac->msg)) { ldb_asprintf_errstring(ldb, "Refusing schema add of %s - cannot combine critical class with RODC filtering", ldb_dn_get_linearized(ac->msg->dn)); return LDB_ERR_UNWILLING_TO_PERFORM; } rdn_value = ldb_dn_get_rdn_val(ac->msg->dn); if (rdn_value == NULL) { return ldb_operr(ldb); } if (!ldb_msg_find_element(ac->msg, "lDAPDisplayName")) { /* the RDN has prefix "CN" */ ret = ldb_msg_add_string(ac->msg, "lDAPDisplayName", samdb_cn_to_lDAPDisplayName(ac->msg, (const char *) rdn_value->data)); if (ret != LDB_SUCCESS) { ldb_oom(ldb); return ret; } } if (!ldb_msg_find_element(ac->msg, "schemaIDGUID")) { struct GUID guid; /* a new GUID */ guid = GUID_random(); ret = dsdb_msg_add_guid(ac->msg, &guid, "schemaIDGUID"); if (ret != LDB_SUCCESS) { ldb_oom(ldb); return ret; } } def_obj_cat_val = ldb_msg_find_ldb_val(ac->msg, "defaultObjectCategory"); if (def_obj_cat_val != NULL) { /* "defaultObjectCategory" has been set by the caller. * Do some checks for consistency. * NOTE: The real constraint check (that * 'defaultObjectCategory' is the DN of the new * objectclass or any parent of it) is still incomplete. * For now we say that 'defaultObjectCategory' is valid * if it exists and it is of objectclass "classSchema". */ ac->dn = ldb_dn_from_ldb_val(ac, ldb, def_obj_cat_val); if (ac->dn == NULL) { ldb_set_errstring(ldb, "Invalid DN for 'defaultObjectCategory'!"); return LDB_ERR_CONSTRAINT_VIOLATION; } } else { /* "defaultObjectCategory" has not been set by the * caller. Use the entry DN for it. */ ac->dn = ac->msg->dn; ret = ldb_msg_add_string(ac->msg, "defaultObjectCategory", ldb_dn_alloc_linearized(ac->msg, ac->dn)); if (ret != LDB_SUCCESS) { ldb_oom(ldb); return ret; } } ret = samldb_add_step(ac, samldb_add_entry); if (ret != LDB_SUCCESS) return ret; /* Now perform the checks for the 'defaultObjectCategory'. The * lookup DN was already saved in "ac->dn" */ ret = samldb_add_step(ac, samldb_find_for_defaultObjectCategory); if (ret != LDB_SUCCESS) return ret; /* -2 is not a valid objectClassCategory so it means the attribute wasn't present */ if (v == -2) { /* Windows 2003 does this*/ ret = samdb_msg_add_uint(ldb, ac->msg, ac->msg, "objectClassCategory", 0); if (ret != LDB_SUCCESS) { return ret; } } break; } case SAMLDB_TYPE_ATTRIBUTE: { const struct ldb_val *rdn_value; struct ldb_message_element *el; rdn_value = ldb_dn_get_rdn_val(ac->msg->dn); if (rdn_value == NULL) { return ldb_operr(ldb); } if (!ldb_msg_find_element(ac->msg, "lDAPDisplayName")) { /* the RDN has prefix "CN" */ ret = ldb_msg_add_string(ac->msg, "lDAPDisplayName", samdb_cn_to_lDAPDisplayName(ac->msg, (const char *) rdn_value->data)); if (ret != LDB_SUCCESS) { ldb_oom(ldb); return ret; } } /* do not allow to mark an attributeSchema as RODC filtered if it * is system-critical */ if (check_rodc_critical_attribute(ac->msg)) { ldb_asprintf_errstring(ldb, "samldb: refusing schema add of %s - cannot combine critical attribute with RODC filtering", ldb_dn_get_linearized(ac->msg->dn)); return LDB_ERR_UNWILLING_TO_PERFORM; } ret = samdb_find_or_add_attribute(ldb, ac->msg, "isSingleValued", "FALSE"); if (ret != LDB_SUCCESS) return ret; if (!ldb_msg_find_element(ac->msg, "schemaIDGUID")) { struct GUID guid; /* a new GUID */ guid = GUID_random(); ret = dsdb_msg_add_guid(ac->msg, &guid, "schemaIDGUID"); if (ret != LDB_SUCCESS) { ldb_oom(ldb); return ret; } } el = ldb_msg_find_element(ac->msg, "attributeSyntax"); if (el) { /* * No need to scream if there isn't as we have code later on * that will take care of it. */ const struct dsdb_syntax *syntax = find_syntax_map_by_ad_oid((const char *)el->values[0].data); if (!syntax) { DEBUG(9, ("Can't find dsdb_syntax object for attributeSyntax %s\n", (const char *)el->values[0].data)); } else { unsigned int v = ldb_msg_find_attr_as_uint(ac->msg, "oMSyntax", 0); const struct ldb_val *val = ldb_msg_find_ldb_val(ac->msg, "oMObjectClass"); if (v == 0) { ret = samdb_msg_add_uint(ldb, ac->msg, ac->msg, "oMSyntax", syntax->oMSyntax); if (ret != LDB_SUCCESS) { return ret; } } if (!val) { struct ldb_val val2 = ldb_val_dup(ldb, &syntax->oMObjectClass); if (val2.length > 0) { ret = ldb_msg_add_value(ac->msg, "oMObjectClass", &val2, NULL); if (ret != LDB_SUCCESS) { return ret; } } } } } /* handle msDS-IntID attribute */ ret = samldb_add_handle_msDS_IntId(ac); if (ret != LDB_SUCCESS) return ret; ret = samldb_add_step(ac, samldb_add_entry); if (ret != LDB_SUCCESS) return ret; break; } default: ldb_asprintf_errstring(ldb, "Invalid entry type!"); return LDB_ERR_OPERATIONS_ERROR; break; } return samldb_first_step(ac); }
332,983,770,533,932,400,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,852
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_find_for_defaultObjectCategory(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); struct ldb_result *res; const char * const no_attrs[] = { NULL }; int ret; ac->res_dn = NULL; ret = dsdb_module_search(ac->module, ac, &res, ac->dn, LDB_SCOPE_BASE, no_attrs, DSDB_SEARCH_SHOW_DN_IN_STORAGE_FORMAT | DSDB_FLAG_NEXT_MODULE, ac->req, "(objectClass=classSchema)"); if (ret == LDB_ERR_NO_SUCH_OBJECT) { /* Don't be pricky when the DN doesn't exist if we have the */ /* RELAX control specified */ if (ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID) == NULL) { ldb_set_errstring(ldb, "samldb_find_defaultObjectCategory: " "Invalid DN for 'defaultObjectCategory'!"); return LDB_ERR_CONSTRAINT_VIOLATION; } } if ((ret != LDB_ERR_NO_SUCH_OBJECT) && (ret != LDB_SUCCESS)) { return ret; } if (ret == LDB_SUCCESS) { /* ensure the defaultObjectCategory has a full GUID */ struct ldb_message *m; m = ldb_msg_new(ac->msg); if (m == NULL) { return ldb_oom(ldb); } m->dn = ac->msg->dn; if (ldb_msg_add_string(m, "defaultObjectCategory", ldb_dn_get_extended_linearized(m, res->msgs[0]->dn, 1)) != LDB_SUCCESS) { return ldb_oom(ldb); } m->elements[0].flags = LDB_FLAG_MOD_REPLACE; ret = dsdb_module_modify(ac->module, m, DSDB_FLAG_NEXT_MODULE, ac->req); if (ret != LDB_SUCCESS) { return ret; } } ac->res_dn = ac->dn; return samldb_next_step(ac); }
16,016,152,656,821,252,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,853
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_generate_sAMAccountName(struct ldb_context *ldb, struct ldb_message *msg) { char *name; /* Format: $000000-000000000000 */ name = talloc_asprintf(msg, "$%.6X-%.6X%.6X", (unsigned int)generate_random(), (unsigned int)generate_random(), (unsigned int)generate_random()); if (name == NULL) { return ldb_oom(ldb); } return ldb_msg_add_steal_string(msg, "sAMAccountName", name); }
144,000,559,426,107,240,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,854
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static bool samldb_krbtgtnumber_available(struct samldb_ctx *ac, uint32_t krbtgt_number) { TALLOC_CTX *tmp_ctx = talloc_new(ac); struct ldb_result *res; const char * const no_attrs[] = { NULL }; int ret; ret = dsdb_module_search(ac->module, tmp_ctx, &res, ldb_get_default_basedn(ldb_module_get_ctx(ac->module)), LDB_SCOPE_SUBTREE, no_attrs, DSDB_FLAG_NEXT_MODULE, ac->req, "(msDC-SecondaryKrbTgtNumber=%u)", krbtgt_number); if (ret == LDB_SUCCESS && res->count == 0) { talloc_free(tmp_ctx); return true; } talloc_free(tmp_ctx); return false; }
114,762,117,569,192,860,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,855
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static bool samldb_msg_add_sid(struct ldb_message *msg, const char *name, const struct dom_sid *sid) { struct ldb_val v; enum ndr_err_code ndr_err; ndr_err = ndr_push_struct_blob(&v, msg, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return false; } return (ldb_msg_add_value(msg, name, &v, NULL) == 0); }
151,991,456,869,612,000,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,856
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_next_step(struct samldb_ctx *ac) { if (ac->curstep->next) { ac->curstep = ac->curstep->next; return ac->curstep->fn(ac); } /* We exit the samldb module here. If someone set an "ares" to forward * controls and response back to the caller, use them. */ if (ac->ares) { return ldb_module_done(ac->req, ac->ares->controls, ac->ares->response, LDB_SUCCESS); } else { return ldb_module_done(ac->req, NULL, NULL, LDB_SUCCESS); } }
201,757,716,713,846,840,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,857
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_prim_group_change(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); const char * const attrs[] = { "primaryGroupID", "memberOf", "userAccountControl", NULL }; struct ldb_result *res, *group_res; struct ldb_message_element *el; struct ldb_message *msg; uint32_t prev_rid, new_rid, uac; struct dom_sid *prev_sid, *new_sid; struct ldb_dn *prev_prim_group_dn, *new_prim_group_dn; int ret; const char * const noattrs[] = { NULL }; el = dsdb_get_single_valued_attr(ac->msg, "primaryGroupID", ac->req->operation); if (el == NULL) { /* we are not affected */ return LDB_SUCCESS; } /* Fetch information from the existing object */ ret = dsdb_module_search_dn(ac->module, ac, &res, ac->msg->dn, attrs, DSDB_FLAG_NEXT_MODULE, ac->req); if (ret != LDB_SUCCESS) { return ret; } uac = ldb_msg_find_attr_as_uint(res->msgs[0], "userAccountControl", 0); /* Finds out the DN of the old primary group */ prev_rid = ldb_msg_find_attr_as_uint(res->msgs[0], "primaryGroupID", (uint32_t) -1); if (prev_rid == (uint32_t) -1) { /* User objects do always have a mandatory "primaryGroupID" * attribute. If this doesn't exist then the object is of the * wrong type. This is the exact Windows error code */ return LDB_ERR_OBJECT_CLASS_VIOLATION; } prev_sid = dom_sid_add_rid(ac, samdb_domain_sid(ldb), prev_rid); if (prev_sid == NULL) { return ldb_operr(ldb); } /* Finds out the DN of the new primary group * Notice: in order to parse the primary group ID correctly we create * a temporary message here. */ msg = ldb_msg_new(ac->msg); if (msg == NULL) { return ldb_module_oom(ac->module); } ret = ldb_msg_add(msg, el, 0); if (ret != LDB_SUCCESS) { return ret; } new_rid = ldb_msg_find_attr_as_uint(msg, "primaryGroupID", (uint32_t) -1); talloc_free(msg); if (new_rid == (uint32_t) -1) { /* we aren't affected of any primary group change */ return LDB_SUCCESS; } if (prev_rid == new_rid) { return LDB_SUCCESS; } if ((uac & UF_SERVER_TRUST_ACCOUNT) && new_rid != DOMAIN_RID_DCS) { ldb_asprintf_errstring(ldb, "%08X: samldb: UF_SERVER_TRUST_ACCOUNT requires " "primaryGroupID=%u!", W_ERROR_V(WERR_DS_CANT_MOD_PRIMARYGROUPID), DOMAIN_RID_DCS); return LDB_ERR_UNWILLING_TO_PERFORM; } if ((uac & UF_PARTIAL_SECRETS_ACCOUNT) && new_rid != DOMAIN_RID_READONLY_DCS) { ldb_asprintf_errstring(ldb, "%08X: samldb: UF_PARTIAL_SECRETS_ACCOUNT requires " "primaryGroupID=%u!", W_ERROR_V(WERR_DS_CANT_MOD_PRIMARYGROUPID), DOMAIN_RID_READONLY_DCS); return LDB_ERR_UNWILLING_TO_PERFORM; } ret = dsdb_module_search(ac->module, ac, &group_res, ldb_get_default_basedn(ldb), LDB_SCOPE_SUBTREE, noattrs, DSDB_FLAG_NEXT_MODULE, ac->req, "(objectSid=%s)", ldap_encode_ndr_dom_sid(ac, prev_sid)); if (ret != LDB_SUCCESS) { return ret; } if (group_res->count != 1) { return ldb_operr(ldb); } prev_prim_group_dn = group_res->msgs[0]->dn; new_sid = dom_sid_add_rid(ac, samdb_domain_sid(ldb), new_rid); if (new_sid == NULL) { return ldb_operr(ldb); } ret = dsdb_module_search(ac->module, ac, &group_res, ldb_get_default_basedn(ldb), LDB_SCOPE_SUBTREE, noattrs, DSDB_FLAG_NEXT_MODULE, ac->req, "(objectSid=%s)", ldap_encode_ndr_dom_sid(ac, new_sid)); if (ret != LDB_SUCCESS) { return ret; } if (group_res->count != 1) { /* Here we know if the specified new primary group candidate is * valid or not. */ return LDB_ERR_UNWILLING_TO_PERFORM; } new_prim_group_dn = group_res->msgs[0]->dn; /* We need to be already a normal member of the new primary * group in order to be successful. */ el = samdb_find_attribute(ldb, res->msgs[0], "memberOf", ldb_dn_get_linearized(new_prim_group_dn)); if (el == NULL) { return LDB_ERR_UNWILLING_TO_PERFORM; } /* Remove the "member" attribute on the new primary group */ msg = ldb_msg_new(ac->msg); if (msg == NULL) { return ldb_module_oom(ac->module); } msg->dn = new_prim_group_dn; ret = samdb_msg_add_delval(ldb, msg, msg, "member", ldb_dn_get_linearized(ac->msg->dn)); if (ret != LDB_SUCCESS) { return ret; } ret = dsdb_module_modify(ac->module, msg, DSDB_FLAG_NEXT_MODULE, ac->req); if (ret != LDB_SUCCESS) { return ret; } talloc_free(msg); /* Add a "member" attribute for the previous primary group */ msg = ldb_msg_new(ac->msg); if (msg == NULL) { return ldb_module_oom(ac->module); } msg->dn = prev_prim_group_dn; ret = samdb_msg_add_addval(ldb, msg, msg, "member", ldb_dn_get_linearized(ac->msg->dn)); if (ret != LDB_SUCCESS) { return ret; } ret = dsdb_module_modify(ac->module, msg, DSDB_FLAG_NEXT_MODULE, ac->req); if (ret != LDB_SUCCESS) { return ret; } talloc_free(msg); return LDB_SUCCESS; }
53,071,370,069,428,720,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,858
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_prim_group_set(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); uint32_t rid; rid = ldb_msg_find_attr_as_uint(ac->msg, "primaryGroupID", (uint32_t) -1); if (rid == (uint32_t) -1) { /* we aren't affected of any primary group set */ return LDB_SUCCESS; } else if (!ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID)) { ldb_set_errstring(ldb, "The primary group isn't settable on add operations!"); return LDB_ERR_UNWILLING_TO_PERFORM; } return samldb_prim_group_tester(ac, rid); }
171,439,677,298,984,700,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,859
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_prim_group_trigger(struct samldb_ctx *ac) { int ret; if (ac->req->operation == LDB_ADD) { ret = samldb_prim_group_set(ac); } else { ret = samldb_prim_group_change(ac); } return ret; }
67,605,757,629,056,270,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,860
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_rodc_add(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); uint32_t krbtgt_number, i_start, i; int ret; char *newpass; struct ldb_val newpass_utf16; /* find a unused msDC-SecondaryKrbTgtNumber */ i_start = generate_random() & 0xFFFF; if (i_start == 0) { i_start = 1; } for (i=i_start; i<=0xFFFF; i++) { if (samldb_krbtgtnumber_available(ac, i)) { krbtgt_number = i; goto found; } } for (i=1; i<i_start; i++) { if (samldb_krbtgtnumber_available(ac, i)) { krbtgt_number = i; goto found; } } ldb_asprintf_errstring(ldb, "%08X: Unable to find available msDS-SecondaryKrbTgtNumber", W_ERROR_V(WERR_NO_SYSTEM_RESOURCES)); return LDB_ERR_OTHER; found: ret = ldb_msg_add_empty(ac->msg, "msDS-SecondaryKrbTgtNumber", LDB_FLAG_INTERNAL_DISABLE_VALIDATION, NULL); if (ret != LDB_SUCCESS) { return ldb_operr(ldb); } ret = samdb_msg_add_uint(ldb, ac->msg, ac->msg, "msDS-SecondaryKrbTgtNumber", krbtgt_number); if (ret != LDB_SUCCESS) { return ldb_operr(ldb); } ret = ldb_msg_add_fmt(ac->msg, "sAMAccountName", "krbtgt_%u", krbtgt_number); if (ret != LDB_SUCCESS) { return ldb_operr(ldb); } newpass = generate_random_password(ac->msg, 128, 255); if (newpass == NULL) { return ldb_operr(ldb); } if (!convert_string_talloc(ac, CH_UNIX, CH_UTF16, newpass, strlen(newpass), (void *)&newpass_utf16.data, &newpass_utf16.length)) { ldb_asprintf_errstring(ldb, "samldb_rodc_add: " "failed to generate UTF16 password from random password"); return LDB_ERR_OPERATIONS_ERROR; } ret = ldb_msg_add_steal_value(ac->msg, "clearTextPassword", &newpass_utf16); if (ret != LDB_SUCCESS) { return ldb_operr(ldb); } return samldb_next_step(ac); }
180,235,104,119,860,100,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,861
samba
b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
https://github.com/samba-team/samba
https://git.samba.org/?p=samba.git;a=commit;h=b000da128b5fb519d2d3f2e7fd20e4a25b7dae7d
CVE-2015-8467: samdb: Match MS15-096 behaviour for userAccountControl Swapping between account types is now restricted Bug: https://bugzilla.samba.org/show_bug.cgi?id=11552 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
0
static int samldb_schema_info_update(struct samldb_ctx *ac) { int ret; struct ldb_context *ldb; struct dsdb_schema *schema; /* replicated update should always go through */ if (ldb_request_get_control(ac->req, DSDB_CONTROL_REPLICATED_UPDATE_OID)) { return LDB_SUCCESS; } /* do not update schemaInfo during provisioning */ if (ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID)) { return LDB_SUCCESS; } ldb = ldb_module_get_ctx(ac->module); schema = dsdb_get_schema(ldb, NULL); if (!schema) { ldb_debug_set(ldb, LDB_DEBUG_FATAL, "samldb_schema_info_update: no dsdb_schema loaded"); DEBUG(0,(__location__ ": %s\n", ldb_errstring(ldb))); return ldb_operr(ldb); } ret = dsdb_module_schema_info_update(ac->module, schema, DSDB_FLAG_NEXT_MODULE| DSDB_FLAG_AS_SYSTEM, ac->req); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, "samldb_schema_info_update: dsdb_module_schema_info_update failed with %s", ldb_errstring(ldb)); return ret; } return LDB_SUCCESS; }
185,734,863,583,902,100,000,000,000,000,000,000,000
samldb.c
96,103,101,282,218,570,000,000,000,000,000,000,000
[ "CWE-264" ]
CVE-2015-8467
The samldb_check_user_account_control_acl function in dsdb/samdb/ldb_modules/samldb.c in Samba 4.x before 4.1.22, 4.2.x before 4.2.7, and 4.3.x before 4.3.3 does not properly check for administrative privileges during creation of machine accounts, which allows remote authenticated users to bypass intended access restrictions by leveraging the existence of a domain with both a Samba DC and a Windows DC, a similar issue to CVE-2015-2535.
https://nvd.nist.gov/vuln/detail/CVE-2015-8467
10,868
savannah
63451a06b7484d220750ed8574d3ee84e156daf5
https://git.savannah.gnu.org/gitweb/?p=gnutls
None
None
0
int main(int argc, char *argv[]) { int opt; char *line; progname = basename(argv[0]); #if POSIXLY_CORRECT cmd_line_options = POSIXLY_CMD_LINE_OPTIONS; #else if (getenv(POSIXLY_CORRECT_STR)) posixly_correct = 1; if (!posixly_correct) cmd_line_options = CMD_LINE_OPTIONS; else cmd_line_options = POSIXLY_CMD_LINE_OPTIONS; #endif setlocale(LC_CTYPE, ""); setlocale(LC_MESSAGES, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); /* Align `#effective:' comments to column 40 for tty's */ if (!posixly_correct && isatty(fileno(stdout))) print_options |= TEXT_SMART_INDENT; while ((opt = getopt_long(argc, argv, cmd_line_options, long_options, NULL)) != -1) { switch (opt) { case 'a': /* acl only */ if (posixly_correct) goto synopsis; opt_print_acl = 1; break; case 'd': /* default acl only */ opt_print_default_acl = 1; break; case 'c': /* no comments */ if (posixly_correct) goto synopsis; opt_comments = 0; break; case 'e': /* all #effective comments */ if (posixly_correct) goto synopsis; print_options |= TEXT_ALL_EFFECTIVE; break; case 'E': /* no #effective comments */ if (posixly_correct) goto synopsis; print_options &= ~(TEXT_SOME_EFFECTIVE | TEXT_ALL_EFFECTIVE); break; case 'R': /* recursive */ if (posixly_correct) goto synopsis; walk_flags |= WALK_TREE_RECURSIVE; break; case 'L': /* follow all symlinks */ if (posixly_correct) goto synopsis; walk_flags |= WALK_TREE_LOGICAL; walk_flags &= ~WALK_TREE_PHYSICAL; break; case 'P': /* skip all symlinks */ if (posixly_correct) goto synopsis; walk_flags |= WALK_TREE_PHYSICAL; walk_flags &= ~WALK_TREE_LOGICAL; break; case 's': /* skip files with only base entries */ if (posixly_correct) goto synopsis; opt_skip_base = 1; break; case 'p': if (posixly_correct) goto synopsis; opt_strip_leading_slash = 0; break; case 't': if (posixly_correct) goto synopsis; opt_tabular = 1; break; case 'n': /* numeric */ opt_numeric = 1; print_options |= TEXT_NUMERIC_IDS; break; case 'v': /* print version */ printf("%s " VERSION "\n", progname); return 0; case 'h': /* help */ help(); return 0; case ':': /* option missing */ case '?': /* unknown option */ default: goto synopsis; } } if (!(opt_print_acl || opt_print_default_acl)) { opt_print_acl = 1; if (!posixly_correct) opt_print_default_acl = 1; } if ((optind == argc) && !posixly_correct) goto synopsis; do { if (optind == argc || strcmp(argv[optind], "-") == 0) { while ((line = next_line(stdin)) != NULL) { if (*line == '\0') continue; had_errors += walk_tree(line, walk_flags, 0, do_print, NULL); } if (!feof(stdin)) { fprintf(stderr, _("%s: Standard input: %s\n"), progname, strerror(errno)); had_errors++; } } else had_errors += walk_tree(argv[optind], walk_flags, 0, do_print, NULL); optind++; } while (optind < argc); return had_errors ? 1 : 0; synopsis: fprintf(stderr, _("Usage: %s [-%s] file ...\n"), progname, cmd_line_options); fprintf(stderr, _("Try `%s --help' for more information.\n"), progname); return 2; }
24,592,511,408,202,600,000,000,000,000,000,000,000
None
null
[]
None
None
https://nvd.nist.gov/vuln/detail/None
10,871
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
static char * MS_CALLBACK srp_password_from_info_cb(SSL *s, void *arg) { return BUF_strdup(s->srp_ctx.info) ; }
83,873,800,857,306,005,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,872
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void)) { int ret=0; #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA) if ( #ifndef OPENSSL_NO_RSA cmd == SSL_CTRL_SET_TMP_RSA_CB || #endif #ifndef OPENSSL_NO_DSA cmd == SSL_CTRL_SET_TMP_DH_CB || #endif 0) { if (!ssl_cert_inst(&s->cert)) { SSLerr(SSL_F_SSL3_CALLBACK_CTRL, ERR_R_MALLOC_FAILURE); return(0); } } #endif switch (cmd) { #ifndef OPENSSL_NO_RSA case SSL_CTRL_SET_TMP_RSA_CB: { s->cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))fp; } break; #endif #ifndef OPENSSL_NO_DH case SSL_CTRL_SET_TMP_DH_CB: { s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp; } break; #endif #ifndef OPENSSL_NO_ECDH case SSL_CTRL_SET_TMP_ECDH_CB: { s->cert->ecdh_tmp_cb = (EC_KEY *(*)(SSL *, int, int))fp; } break; #endif #ifndef OPENSSL_NO_TLSEXT case SSL_CTRL_SET_TLSEXT_DEBUG_CB: s->tlsext_debug_cb=(void (*)(SSL *,int ,int, unsigned char *, int, void *))fp; break; #endif default: break; } return(ret); }
156,133,537,989,166,810,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,873
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, STACK_OF(SSL_CIPHER) *srvr) { SSL_CIPHER *c,*ret=NULL; STACK_OF(SSL_CIPHER) *prio, *allow; int i,ii,ok; #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_EC) unsigned int j; int ec_ok, ec_nid; unsigned char ec_search1 = 0, ec_search2 = 0; #endif CERT *cert; unsigned long alg_k,alg_a,mask_k,mask_a,emask_k,emask_a; /* Let's see which ciphers we can support */ cert=s->cert; #if 0 /* Do not set the compare functions, because this may lead to a * reordering by "id". We want to keep the original ordering. * We may pay a price in performance during sk_SSL_CIPHER_find(), * but would have to pay with the price of sk_SSL_CIPHER_dup(). */ sk_SSL_CIPHER_set_cmp_func(srvr, ssl_cipher_ptr_id_cmp); sk_SSL_CIPHER_set_cmp_func(clnt, ssl_cipher_ptr_id_cmp); #endif #ifdef CIPHER_DEBUG printf("Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr), (void *)srvr); for(i=0 ; i < sk_SSL_CIPHER_num(srvr) ; ++i) { c=sk_SSL_CIPHER_value(srvr,i); printf("%p:%s\n",(void *)c,c->name); } printf("Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt), (void *)clnt); for(i=0 ; i < sk_SSL_CIPHER_num(clnt) ; ++i) { c=sk_SSL_CIPHER_value(clnt,i); printf("%p:%s\n",(void *)c,c->name); } #endif if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { prio = srvr; allow = clnt; } else { prio = clnt; allow = srvr; } for (i=0; i<sk_SSL_CIPHER_num(prio); i++) { c=sk_SSL_CIPHER_value(prio,i); /* Skip TLS v1.2 only ciphersuites if lower than v1.2 */ if ((c->algorithm_ssl & SSL_TLSV1_2) && (TLS1_get_version(s) < TLS1_2_VERSION)) continue; ssl_set_cert_masks(cert,c); mask_k = cert->mask_k; mask_a = cert->mask_a; emask_k = cert->export_mask_k; emask_a = cert->export_mask_a; #ifndef OPENSSL_NO_SRP mask_k=cert->mask_k | s->srp_ctx.srp_Mask; emask_k=cert->export_mask_k | s->srp_ctx.srp_Mask; #endif #ifdef KSSL_DEBUG /* printf("ssl3_choose_cipher %d alg= %lx\n", i,c->algorithms);*/ #endif /* KSSL_DEBUG */ alg_k=c->algorithm_mkey; alg_a=c->algorithm_auth; #ifndef OPENSSL_NO_KRB5 if (alg_k & SSL_kKRB5) { if ( !kssl_keytab_is_available(s->kssl_ctx) ) continue; } #endif /* OPENSSL_NO_KRB5 */ #ifndef OPENSSL_NO_PSK /* with PSK there must be server callback set */ if ((alg_k & SSL_kPSK) && s->psk_server_callback == NULL) continue; #endif /* OPENSSL_NO_PSK */ if (SSL_C_IS_EXPORT(c)) { ok = (alg_k & emask_k) && (alg_a & emask_a); #ifdef CIPHER_DEBUG printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a, (void *)c,c->name); #endif } else { ok = (alg_k & mask_k) && (alg_a & mask_a); #ifdef CIPHER_DEBUG printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(void *)c, c->name); #endif } #ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_EC if ( /* if we are considering an ECC cipher suite that uses our certificate */ (alg_a & SSL_aECDSA || alg_a & SSL_aECDH) /* and we have an ECC certificate */ && (s->cert->pkeys[SSL_PKEY_ECC].x509 != NULL) /* and the client specified a Supported Point Formats extension */ && ((s->session->tlsext_ecpointformatlist_length > 0) && (s->session->tlsext_ecpointformatlist != NULL)) /* and our certificate's point is compressed */ && ( (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info != NULL) && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key != NULL) && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key != NULL) && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data != NULL) && ( (*(s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data) == POINT_CONVERSION_COMPRESSED) || (*(s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data) == POINT_CONVERSION_COMPRESSED + 1) ) ) ) { ec_ok = 0; /* if our certificate's curve is over a field type that the client does not support * then do not allow this cipher suite to be negotiated */ if ( (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec != NULL) && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group != NULL) && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth != NULL) && (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_prime_field) ) { for (j = 0; j < s->session->tlsext_ecpointformatlist_length; j++) { if (s->session->tlsext_ecpointformatlist[j] == TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime) { ec_ok = 1; break; } } } else if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_characteristic_two_field) { for (j = 0; j < s->session->tlsext_ecpointformatlist_length; j++) { if (s->session->tlsext_ecpointformatlist[j] == TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2) { ec_ok = 1; break; } } } ok = ok && ec_ok; } if ( /* if we are considering an ECC cipher suite that uses our certificate */ (alg_a & SSL_aECDSA || alg_a & SSL_aECDH) /* and we have an ECC certificate */ && (s->cert->pkeys[SSL_PKEY_ECC].x509 != NULL) /* and the client specified an EllipticCurves extension */ && ((s->session->tlsext_ellipticcurvelist_length > 0) && (s->session->tlsext_ellipticcurvelist != NULL)) ) { ec_ok = 0; if ( (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec != NULL) && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group != NULL) ) { ec_nid = EC_GROUP_get_curve_name(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group); if ((ec_nid == 0) && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth != NULL) ) { if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_prime_field) { ec_search1 = 0xFF; ec_search2 = 0x01; } else if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_characteristic_two_field) { ec_search1 = 0xFF; ec_search2 = 0x02; } } else { ec_search1 = 0x00; ec_search2 = tls1_ec_nid2curve_id(ec_nid); } if ((ec_search1 != 0) || (ec_search2 != 0)) { for (j = 0; j < s->session->tlsext_ellipticcurvelist_length / 2; j++) { if ((s->session->tlsext_ellipticcurvelist[2*j] == ec_search1) && (s->session->tlsext_ellipticcurvelist[2*j+1] == ec_search2)) { ec_ok = 1; break; } } } } ok = ok && ec_ok; } if ( /* if we are considering an ECC cipher suite that uses an ephemeral EC key */ (alg_k & SSL_kEECDH) /* and we have an ephemeral EC key */ && (s->cert->ecdh_tmp != NULL) /* and the client specified an EllipticCurves extension */ && ((s->session->tlsext_ellipticcurvelist_length > 0) && (s->session->tlsext_ellipticcurvelist != NULL)) ) { ec_ok = 0; if (s->cert->ecdh_tmp->group != NULL) { ec_nid = EC_GROUP_get_curve_name(s->cert->ecdh_tmp->group); if ((ec_nid == 0) && (s->cert->ecdh_tmp->group->meth != NULL) ) { if (EC_METHOD_get_field_type(s->cert->ecdh_tmp->group->meth) == NID_X9_62_prime_field) { ec_search1 = 0xFF; ec_search2 = 0x01; } else if (EC_METHOD_get_field_type(s->cert->ecdh_tmp->group->meth) == NID_X9_62_characteristic_two_field) { ec_search1 = 0xFF; ec_search2 = 0x02; } } else { ec_search1 = 0x00; ec_search2 = tls1_ec_nid2curve_id(ec_nid); } if ((ec_search1 != 0) || (ec_search2 != 0)) { for (j = 0; j < s->session->tlsext_ellipticcurvelist_length / 2; j++) { if ((s->session->tlsext_ellipticcurvelist[2*j] == ec_search1) && (s->session->tlsext_ellipticcurvelist[2*j+1] == ec_search2)) { ec_ok = 1; break; } } } } ok = ok && ec_ok; } #endif /* OPENSSL_NO_EC */ #endif /* OPENSSL_NO_TLSEXT */ if (!ok) continue; ii=sk_SSL_CIPHER_find(allow,c); if (ii >= 0) { #if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_TLSEXT) if ((alg_k & SSL_kEECDH) && (alg_a & SSL_aECDSA) && s->s3->is_probably_safari) { if (!ret) ret=sk_SSL_CIPHER_value(allow,ii); continue; } #endif ret=sk_SSL_CIPHER_value(allow,ii); break; } } return(ret); }
109,588,182,860,342,700,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,874
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
void ssl3_clear(SSL *s) { unsigned char *rp,*wp; size_t rlen, wlen; int init_extra; #ifdef TLSEXT_TYPE_opaque_prf_input if (s->s3->client_opaque_prf_input != NULL) OPENSSL_free(s->s3->client_opaque_prf_input); s->s3->client_opaque_prf_input = NULL; if (s->s3->server_opaque_prf_input != NULL) OPENSSL_free(s->s3->server_opaque_prf_input); s->s3->server_opaque_prf_input = NULL; #endif ssl3_cleanup_key_block(s); if (s->s3->tmp.ca_names != NULL) sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free); if (s->s3->rrec.comp != NULL) { OPENSSL_free(s->s3->rrec.comp); s->s3->rrec.comp=NULL; } #ifndef OPENSSL_NO_DH if (s->s3->tmp.dh != NULL) { DH_free(s->s3->tmp.dh); s->s3->tmp.dh = NULL; } #endif #ifndef OPENSSL_NO_ECDH if (s->s3->tmp.ecdh != NULL) { EC_KEY_free(s->s3->tmp.ecdh); s->s3->tmp.ecdh = NULL; } #endif #ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_EC s->s3->is_probably_safari = 0; #endif /* !OPENSSL_NO_EC */ #endif /* !OPENSSL_NO_TLSEXT */ rp = s->s3->rbuf.buf; wp = s->s3->wbuf.buf; rlen = s->s3->rbuf.len; wlen = s->s3->wbuf.len; init_extra = s->s3->init_extra; if (s->s3->handshake_buffer) { BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; } if (s->s3->handshake_dgst) { ssl3_free_digest_list(s); } memset(s->s3,0,sizeof *s->s3); s->s3->rbuf.buf = rp; s->s3->wbuf.buf = wp; s->s3->rbuf.len = rlen; s->s3->wbuf.len = wlen; s->s3->init_extra = init_extra; ssl_free_wbio_buffer(s); s->packet_length=0; s->s3->renegotiate=0; s->s3->total_renegotiations=0; s->s3->num_renegotiations=0; s->s3->in_read_app_data=0; s->version=SSL3_VERSION; #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) if (s->next_proto_negotiated) { OPENSSL_free(s->next_proto_negotiated); s->next_proto_negotiated = NULL; s->next_proto_negotiated_len = 0; } #endif }
107,234,555,939,230,780,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,875
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) { int ret=0; #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA) if ( #ifndef OPENSSL_NO_RSA cmd == SSL_CTRL_SET_TMP_RSA || cmd == SSL_CTRL_SET_TMP_RSA_CB || #endif #ifndef OPENSSL_NO_DSA cmd == SSL_CTRL_SET_TMP_DH || cmd == SSL_CTRL_SET_TMP_DH_CB || #endif 0) { if (!ssl_cert_inst(&s->cert)) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_MALLOC_FAILURE); return(0); } } #endif switch (cmd) { case SSL_CTRL_GET_SESSION_REUSED: ret=s->hit; break; case SSL_CTRL_GET_CLIENT_CERT_REQUEST: break; case SSL_CTRL_GET_NUM_RENEGOTIATIONS: ret=s->s3->num_renegotiations; break; case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS: ret=s->s3->num_renegotiations; s->s3->num_renegotiations=0; break; case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS: ret=s->s3->total_renegotiations; break; case SSL_CTRL_GET_FLAGS: ret=(int)(s->s3->flags); break; #ifndef OPENSSL_NO_RSA case SSL_CTRL_NEED_TMP_RSA: if ((s->cert != NULL) && (s->cert->rsa_tmp == NULL) && ((s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL) || (EVP_PKEY_size(s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) > (512/8)))) ret = 1; break; case SSL_CTRL_SET_TMP_RSA: { RSA *rsa = (RSA *)parg; if (rsa == NULL) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER); return(ret); } if ((rsa = RSAPrivateKey_dup(rsa)) == NULL) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_RSA_LIB); return(ret); } if (s->cert->rsa_tmp != NULL) RSA_free(s->cert->rsa_tmp); s->cert->rsa_tmp = rsa; ret = 1; } break; case SSL_CTRL_SET_TMP_RSA_CB: { SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(ret); } break; #endif #ifndef OPENSSL_NO_DH case SSL_CTRL_SET_TMP_DH: { DH *dh = (DH *)parg; if (dh == NULL) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER); return(ret); } if ((dh = DHparams_dup(dh)) == NULL) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB); return(ret); } if (!(s->options & SSL_OP_SINGLE_DH_USE)) { if (!DH_generate_key(dh)) { DH_free(dh); SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB); return(ret); } } if (s->cert->dh_tmp != NULL) DH_free(s->cert->dh_tmp); s->cert->dh_tmp = dh; ret = 1; } break; case SSL_CTRL_SET_TMP_DH_CB: { SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(ret); } break; #endif #ifndef OPENSSL_NO_ECDH case SSL_CTRL_SET_TMP_ECDH: { EC_KEY *ecdh = NULL; if (parg == NULL) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER); return(ret); } if (!EC_KEY_up_ref((EC_KEY *)parg)) { SSLerr(SSL_F_SSL3_CTRL,ERR_R_ECDH_LIB); return(ret); } ecdh = (EC_KEY *)parg; if (!(s->options & SSL_OP_SINGLE_ECDH_USE)) { if (!EC_KEY_generate_key(ecdh)) { EC_KEY_free(ecdh); SSLerr(SSL_F_SSL3_CTRL,ERR_R_ECDH_LIB); return(ret); } } if (s->cert->ecdh_tmp != NULL) EC_KEY_free(s->cert->ecdh_tmp); s->cert->ecdh_tmp = ecdh; ret = 1; } break; case SSL_CTRL_SET_TMP_ECDH_CB: { SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(ret); } break; #endif /* !OPENSSL_NO_ECDH */ #ifndef OPENSSL_NO_TLSEXT case SSL_CTRL_SET_TLSEXT_HOSTNAME: if (larg == TLSEXT_NAMETYPE_host_name) { if (s->tlsext_hostname != NULL) OPENSSL_free(s->tlsext_hostname); s->tlsext_hostname = NULL; ret = 1; if (parg == NULL) break; if (strlen((char *)parg) > TLSEXT_MAXLEN_host_name) { SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME); return 0; } if ((s->tlsext_hostname = BUF_strdup((char *)parg)) == NULL) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_INTERNAL_ERROR); return 0; } } else { SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE); return 0; } break; case SSL_CTRL_SET_TLSEXT_DEBUG_ARG: s->tlsext_debug_arg=parg; ret = 1; break; #ifdef TLSEXT_TYPE_opaque_prf_input case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT: if (larg > 12288) /* actual internal limit is 2^16 for the complete hello message * (including the cert chain and everything) */ { SSLerr(SSL_F_SSL3_CTRL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG); break; } if (s->tlsext_opaque_prf_input != NULL) OPENSSL_free(s->tlsext_opaque_prf_input); if ((size_t)larg == 0) s->tlsext_opaque_prf_input = OPENSSL_malloc(1); /* dummy byte just to get non-NULL */ else s->tlsext_opaque_prf_input = BUF_memdup(parg, (size_t)larg); if (s->tlsext_opaque_prf_input != NULL) { s->tlsext_opaque_prf_input_len = (size_t)larg; ret = 1; } else s->tlsext_opaque_prf_input_len = 0; break; #endif case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE: s->tlsext_status_type=larg; ret = 1; break; case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS: *(STACK_OF(X509_EXTENSION) **)parg = s->tlsext_ocsp_exts; ret = 1; break; case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS: s->tlsext_ocsp_exts = parg; ret = 1; break; case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS: *(STACK_OF(OCSP_RESPID) **)parg = s->tlsext_ocsp_ids; ret = 1; break; case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS: s->tlsext_ocsp_ids = parg; ret = 1; break; case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP: *(unsigned char **)parg = s->tlsext_ocsp_resp; return s->tlsext_ocsp_resplen; case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP: if (s->tlsext_ocsp_resp) OPENSSL_free(s->tlsext_ocsp_resp); s->tlsext_ocsp_resp = parg; s->tlsext_ocsp_resplen = larg; ret = 1; break; #ifndef OPENSSL_NO_HEARTBEATS case SSL_CTRL_TLS_EXT_SEND_HEARTBEAT: if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER) ret = dtls1_heartbeat(s); else ret = tls1_heartbeat(s); break; case SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING: ret = s->tlsext_hb_pending; break; case SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS: if (larg) s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_RECV_REQUESTS; else s->tlsext_heartbeat &= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS; ret = 1; break; #endif #endif /* !OPENSSL_NO_TLSEXT */ default: break; } return(ret); }
16,200,999,929,990,880,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,876
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) { CERT *cert; cert=ctx->cert; switch (cmd) { #ifndef OPENSSL_NO_RSA case SSL_CTRL_SET_TMP_RSA_CB: { cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))fp; } break; #endif #ifndef OPENSSL_NO_DH case SSL_CTRL_SET_TMP_DH_CB: { cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp; } break; #endif #ifndef OPENSSL_NO_ECDH case SSL_CTRL_SET_TMP_ECDH_CB: { cert->ecdh_tmp_cb = (EC_KEY *(*)(SSL *, int, int))fp; } break; #endif #ifndef OPENSSL_NO_TLSEXT case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB: ctx->tlsext_servername_callback=(int (*)(SSL *,int *,void *))fp; break; #ifdef TLSEXT_TYPE_opaque_prf_input case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB: ctx->tlsext_opaque_prf_input_callback = (int (*)(SSL *,void *, size_t, void *))fp; break; #endif case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB: ctx->tlsext_status_cb=(int (*)(SSL *,void *))fp; break; case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB: ctx->tlsext_ticket_key_cb=(int (*)(SSL *,unsigned char *, unsigned char *, EVP_CIPHER_CTX *, HMAC_CTX *, int))fp; break; #ifndef OPENSSL_NO_SRP case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB: ctx->srp_ctx.srp_Mask|=SSL_kSRP; ctx->srp_ctx.SRP_verify_param_callback=(int (*)(SSL *,void *))fp; break; case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB: ctx->srp_ctx.srp_Mask|=SSL_kSRP; ctx->srp_ctx.TLS_ext_srp_username_callback=(int (*)(SSL *,int *,void *))fp; break; case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB: ctx->srp_ctx.srp_Mask|=SSL_kSRP; ctx->srp_ctx.SRP_give_srp_client_pwd_callback=(char *(*)(SSL *,void *))fp; break; #endif #endif default: return(0); } return(1); }
62,479,080,485,106,510,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,877
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) { CERT *cert; cert=ctx->cert; switch (cmd) { #ifndef OPENSSL_NO_RSA case SSL_CTRL_NEED_TMP_RSA: if ( (cert->rsa_tmp == NULL) && ((cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL) || (EVP_PKEY_size(cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) > (512/8))) ) return(1); else return(0); /* break; */ case SSL_CTRL_SET_TMP_RSA: { RSA *rsa; int i; rsa=(RSA *)parg; i=1; if (rsa == NULL) i=0; else { if ((rsa=RSAPrivateKey_dup(rsa)) == NULL) i=0; } if (!i) { SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_RSA_LIB); return(0); } else { if (cert->rsa_tmp != NULL) RSA_free(cert->rsa_tmp); cert->rsa_tmp=rsa; return(1); } } /* break; */ case SSL_CTRL_SET_TMP_RSA_CB: { SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(0); } break; #endif #ifndef OPENSSL_NO_DH case SSL_CTRL_SET_TMP_DH: { DH *new=NULL,*dh; dh=(DH *)parg; if ((new=DHparams_dup(dh)) == NULL) { SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB); return 0; } if (!(ctx->options & SSL_OP_SINGLE_DH_USE)) { if (!DH_generate_key(new)) { SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB); DH_free(new); return 0; } } if (cert->dh_tmp != NULL) DH_free(cert->dh_tmp); cert->dh_tmp=new; return 1; } /*break; */ case SSL_CTRL_SET_TMP_DH_CB: { SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(0); } break; #endif #ifndef OPENSSL_NO_ECDH case SSL_CTRL_SET_TMP_ECDH: { EC_KEY *ecdh = NULL; if (parg == NULL) { SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_ECDH_LIB); return 0; } ecdh = EC_KEY_dup((EC_KEY *)parg); if (ecdh == NULL) { SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_EC_LIB); return 0; } if (!(ctx->options & SSL_OP_SINGLE_ECDH_USE)) { if (!EC_KEY_generate_key(ecdh)) { EC_KEY_free(ecdh); SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_ECDH_LIB); return 0; } } if (cert->ecdh_tmp != NULL) { EC_KEY_free(cert->ecdh_tmp); } cert->ecdh_tmp = ecdh; return 1; } /* break; */ case SSL_CTRL_SET_TMP_ECDH_CB: { SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(0); } break; #endif /* !OPENSSL_NO_ECDH */ #ifndef OPENSSL_NO_TLSEXT case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG: ctx->tlsext_servername_arg=parg; break; case SSL_CTRL_SET_TLSEXT_TICKET_KEYS: case SSL_CTRL_GET_TLSEXT_TICKET_KEYS: { unsigned char *keys = parg; if (!keys) return 48; if (larg != 48) { SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_TICKET_KEYS_LENGTH); return 0; } if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) { memcpy(ctx->tlsext_tick_key_name, keys, 16); memcpy(ctx->tlsext_tick_hmac_key, keys + 16, 16); memcpy(ctx->tlsext_tick_aes_key, keys + 32, 16); } else { memcpy(keys, ctx->tlsext_tick_key_name, 16); memcpy(keys + 16, ctx->tlsext_tick_hmac_key, 16); memcpy(keys + 32, ctx->tlsext_tick_aes_key, 16); } return 1; } #ifdef TLSEXT_TYPE_opaque_prf_input case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG: ctx->tlsext_opaque_prf_input_callback_arg = parg; return 1; #endif case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG: ctx->tlsext_status_arg=parg; return 1; break; #ifndef OPENSSL_NO_SRP case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME: ctx->srp_ctx.srp_Mask|=SSL_kSRP; if (ctx->srp_ctx.login != NULL) OPENSSL_free(ctx->srp_ctx.login); ctx->srp_ctx.login = NULL; if (parg == NULL) break; if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) { SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME); return 0; } if ((ctx->srp_ctx.login = BUF_strdup((char *)parg)) == NULL) { SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR); return 0; } break; case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD: ctx->srp_ctx.SRP_give_srp_client_pwd_callback=srp_password_from_info_cb; ctx->srp_ctx.info=parg; break; case SSL_CTRL_SET_SRP_ARG: ctx->srp_ctx.srp_Mask|=SSL_kSRP; ctx->srp_ctx.SRP_cb_arg=parg; break; case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH: ctx->srp_ctx.strength=larg; break; #endif #endif /* !OPENSSL_NO_TLSEXT */ /* A Thawte special :-) */ case SSL_CTRL_EXTRA_CHAIN_CERT: if (ctx->extra_certs == NULL) { if ((ctx->extra_certs=sk_X509_new_null()) == NULL) return(0); } sk_X509_push(ctx->extra_certs,(X509 *)parg); break; case SSL_CTRL_GET_EXTRA_CHAIN_CERTS: *(STACK_OF(X509) **)parg = ctx->extra_certs; break; case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS: if (ctx->extra_certs) { sk_X509_pop_free(ctx->extra_certs, X509_free); ctx->extra_certs = NULL; } break; default: return(0); } return(1); }
194,145,129,889,191,820,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,878
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
long ssl3_default_timeout(void) { /* 2 hours, the 24 hours mentioned in the SSLv3 spec * is way too long for http, the cache would over fill */ return(60*60*2); }
129,063,646,903,961,800,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,879
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
const SSL_CIPHER *ssl3_get_cipher(unsigned int u) { if (u < SSL3_NUM_CIPHERS) return(&(ssl3_ciphers[SSL3_NUM_CIPHERS-1-u])); else return(NULL); }
233,184,912,941,269,400,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,880
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p) { SSL_CIPHER c; const SSL_CIPHER *cp; unsigned long id; id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1]; c.id=id; cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS); #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES if (cp == NULL) fprintf(stderr, "Unknown cipher ID %x\n", (p[0] << 8) | p[1]); #endif if (cp == NULL || cp->valid == 0) return NULL; else return cp; }
85,491,662,104,860,720,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,881
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_get_req_cert_type(SSL *s, unsigned char *p) { int ret=0; unsigned long alg_k; alg_k = s->s3->tmp.new_cipher->algorithm_mkey; #ifndef OPENSSL_NO_GOST if (s->version >= TLS1_VERSION) { if (alg_k & SSL_kGOST) { p[ret++]=TLS_CT_GOST94_SIGN; p[ret++]=TLS_CT_GOST01_SIGN; return(ret); } } #endif #ifndef OPENSSL_NO_DH if (alg_k & (SSL_kDHr|SSL_kEDH)) { # ifndef OPENSSL_NO_RSA p[ret++]=SSL3_CT_RSA_FIXED_DH; # endif # ifndef OPENSSL_NO_DSA p[ret++]=SSL3_CT_DSS_FIXED_DH; # endif } if ((s->version == SSL3_VERSION) && (alg_k & (SSL_kEDH|SSL_kDHd|SSL_kDHr))) { # ifndef OPENSSL_NO_RSA p[ret++]=SSL3_CT_RSA_EPHEMERAL_DH; # endif # ifndef OPENSSL_NO_DSA p[ret++]=SSL3_CT_DSS_EPHEMERAL_DH; # endif } #endif /* !OPENSSL_NO_DH */ #ifndef OPENSSL_NO_RSA p[ret++]=SSL3_CT_RSA_SIGN; #endif #ifndef OPENSSL_NO_DSA p[ret++]=SSL3_CT_DSS_SIGN; #endif #ifndef OPENSSL_NO_ECDH if ((alg_k & (SSL_kECDHr|SSL_kECDHe)) && (s->version >= TLS1_VERSION)) { p[ret++]=TLS_CT_RSA_FIXED_ECDH; p[ret++]=TLS_CT_ECDSA_FIXED_ECDH; } #endif #ifndef OPENSSL_NO_ECDSA /* ECDSA certs can be used with RSA cipher suites as well * so we don't need to check for SSL_kECDH or SSL_kEECDH */ if (s->version >= TLS1_VERSION) { p[ret++]=TLS_CT_ECDSA_SIGN; } #endif return(ret); }
198,217,309,300,273,100,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,882
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_num_ciphers(void) { return(SSL3_NUM_CIPHERS); }
284,648,602,599,129,400,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,883
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_peek(SSL *s, void *buf, int len) { return ssl3_read_internal(s, buf, len, 1); }
161,283,084,861,831,020,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,884
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_pending(const SSL *s) { if (s->rstate == SSL_ST_READ_BODY) return 0; return (s->s3->rrec.type == SSL3_RT_APPLICATION_DATA) ? s->s3->rrec.length : 0; }
83,010,926,611,513,160,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,885
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { long l; if (p != NULL) { l=c->id; if ((l & 0xff000000) != 0x03000000) return(0); p[0]=((unsigned char)(l>> 8L))&0xFF; p[1]=((unsigned char)(l ))&0xFF; } return(2); }
104,695,331,918,521,470,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,886
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_read(SSL *s, void *buf, int len) { return ssl3_read_internal(s, buf, len, 0); }
254,521,170,376,596,500,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,887
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
static int ssl3_read_internal(SSL *s, void *buf, int len, int peek) { int ret; clear_sys_error(); if (s->s3->renegotiate) ssl3_renegotiate_check(s); s->s3->in_read_app_data=1; ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek); if ((ret == -1) && (s->s3->in_read_app_data == 2)) { /* ssl3_read_bytes decided to call s->handshake_func, which * called ssl3_read_bytes to read handshake data. * However, ssl3_read_bytes actually found application data * and thinks that application data makes sense here; so disable * handshake processing and try to read application data again. */ s->in_handshake++; ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek); s->in_handshake--; } else s->s3->in_read_app_data=0; return(ret); }
259,331,538,805,733,050,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,888
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_renegotiate(SSL *s) { if (s->handshake_func == NULL) return(1); if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); s->s3->renegotiate=1; return(1); }
126,114,022,060,016,260,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,889
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_shutdown(SSL *s) { int ret; /* Don't do anything much if we have not done the handshake or * we don't want to send messages :-) */ if ((s->quiet_shutdown) || (s->state == SSL_ST_BEFORE)) { s->shutdown=(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); return(1); } if (!(s->shutdown & SSL_SENT_SHUTDOWN)) { s->shutdown|=SSL_SENT_SHUTDOWN; #if 1 ssl3_send_alert(s,SSL3_AL_WARNING,SSL_AD_CLOSE_NOTIFY); #endif /* our shutdown alert has been sent now, and if it still needs * to be written, s->s3->alert_dispatch will be true */ if (s->s3->alert_dispatch) return(-1); /* return WANT_WRITE */ } else if (s->s3->alert_dispatch) { /* resend it if not sent */ #if 1 ret=s->method->ssl_dispatch_alert(s); if(ret == -1) { /* we only get to return -1 here the 2nd/Nth * invocation, we must have already signalled * return 0 upon a previous invoation, * return WANT_WRITE */ return(ret); } #endif } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) { /* If we are waiting for a close from our peer, we are closed */ s->method->ssl_read_bytes(s,0,NULL,0,0); if(!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) { return(-1); /* return WANT_READ */ } } if ((s->shutdown == (SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN)) && !s->s3->alert_dispatch) return(1); else return(0); }
290,380,816,740,477,850,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,890
openssl
ca989269a2876bae79393bd54c3e72d49975fc75
https://github.com/openssl/openssl
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=ca989269a2876bae79393bd54c3e72d49975fc75
Use version in SSL_METHOD not SSL structure. When deciding whether to use TLS 1.2 PRF and record hash algorithms use the version number in the corresponding SSL_METHOD structure instead of the SSL structure. The SSL structure version is sometimes inaccurate. Note: OpenSSL 1.0.2 and later effectively do this already. (CVE-2013-6449)
0
int ssl3_write(SSL *s, const void *buf, int len) { int ret,n; #if 0 if (s->shutdown & SSL_SEND_SHUTDOWN) { s->rwstate=SSL_NOTHING; return(0); } #endif clear_sys_error(); if (s->s3->renegotiate) ssl3_renegotiate_check(s); /* This is an experimental flag that sends the * last handshake message in the same packet as the first * use data - used to see if it helps the TCP protocol during * session-id reuse */ /* The second test is because the buffer may have been removed */ if ((s->s3->flags & SSL3_FLAGS_POP_BUFFER) && (s->wbio == s->bbio)) { /* First time through, we write into the buffer */ if (s->s3->delay_buf_pop_ret == 0) { ret=ssl3_write_bytes(s,SSL3_RT_APPLICATION_DATA, buf,len); if (ret <= 0) return(ret); s->s3->delay_buf_pop_ret=ret; } s->rwstate=SSL_WRITING; n=BIO_flush(s->wbio); if (n <= 0) return(n); s->rwstate=SSL_NOTHING; /* We have flushed the buffer, so remove it */ ssl_free_wbio_buffer(s); s->s3->flags&= ~SSL3_FLAGS_POP_BUFFER; ret=s->s3->delay_buf_pop_ret; s->s3->delay_buf_pop_ret=0; } else { ret=s->method->ssl_write_bytes(s,SSL3_RT_APPLICATION_DATA, buf,len); if (ret <= 0) return(ret); } return(ret); }
214,899,927,337,244,830,000,000,000,000,000,000,000
None
null
[ "CWE-310" ]
CVE-2013-6449
The ssl_get_algorithm2 function in ssl/s3_lib.c in OpenSSL before 1.0.2 obtains a certain version number from an incorrect data structure, which allows remote attackers to cause a denial of service (daemon crash) via crafted traffic from a TLS 1.2 client.
https://nvd.nist.gov/vuln/detail/CVE-2013-6449
10,894
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
freefileinfo (struct fileinfo *f) { while (f) { struct fileinfo *next = f->next; xfree (f->name); if (f->linkto) xfree (f->linkto); xfree (f); f = next; } }
72,979,141,031,642,510,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,895
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_do_pasv (int csock, ip_address *addr, int *port) { uerr_t err; /* We need to determine the address family and need to call getpeername, so while we're at it, store the address to ADDR. ftp_pasv and ftp_lpsv can simply override it. */ if (!socket_ip_address (csock, addr, ENDPOINT_PEER)) abort (); /* If our control connection is over IPv6, then we first try EPSV and then * LPSV if the former is not supported. If the control connection is over * IPv4, we simply issue the good old PASV request. */ switch (addr->family) { case AF_INET: if (!opt.server_response) logputs (LOG_VERBOSE, "==> PASV ... "); err = ftp_pasv (csock, addr, port); break; case AF_INET6: if (!opt.server_response) logputs (LOG_VERBOSE, "==> EPSV ... "); err = ftp_epsv (csock, addr, port); /* If EPSV is not supported try LPSV */ if (err == FTPNOPASV) { if (!opt.server_response) logputs (LOG_VERBOSE, "==> LPSV ... "); err = ftp_lpsv (csock, addr, port); } break; default: abort (); } return err; }
37,760,122,740,094,000,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,896
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_do_pasv (int csock, ip_address *addr, int *port) { if (!opt.server_response) logputs (LOG_VERBOSE, "==> PASV ... "); return ftp_pasv (csock, addr, port); }
139,837,436,046,034,830,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,897
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_do_port (int csock, int *local_sock) { uerr_t err; ip_address cip; if (!socket_ip_address (csock, &cip, ENDPOINT_PEER)) abort (); /* If our control connection is over IPv6, then we first try EPRT and then * LPRT if the former is not supported. If the control connection is over * IPv4, we simply issue the good old PORT request. */ switch (cip.family) { case AF_INET: if (!opt.server_response) logputs (LOG_VERBOSE, "==> PORT ... "); err = ftp_port (csock, local_sock); break; case AF_INET6: if (!opt.server_response) logputs (LOG_VERBOSE, "==> EPRT ... "); err = ftp_eprt (csock, local_sock); /* If EPRT is not supported try LPRT */ if (err == FTPPORTERR) { if (!opt.server_response) logputs (LOG_VERBOSE, "==> LPRT ... "); err = ftp_lprt (csock, local_sock); } break; default: abort (); } return err; }
122,148,607,059,221,270,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,898
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_do_port (int csock, int *local_sock) { if (!opt.server_response) logputs (LOG_VERBOSE, "==> PORT ... "); return ftp_port (csock, local_sock); }
35,245,619,663,142,155,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,899
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_get_listing (struct url *u, ccon *con, struct fileinfo **f) { uerr_t err; char *uf; /* url file name */ char *lf; /* list file name */ char *old_target = con->target; con->st &= ~ON_YOUR_OWN; con->cmd |= (DO_LIST | LEAVE_PENDING); con->cmd &= ~DO_RETR; /* Find the listing file name. We do it by taking the file name of the URL and replacing the last component with the listing file name. */ uf = url_file_name (u, NULL); lf = file_merge (uf, LIST_FILENAME); xfree (uf); DEBUGP ((_("Using %s as listing tmp file.\n"), quote (lf))); con->target = xstrdup (lf); xfree (lf); err = ftp_loop_internal (u, NULL, con, NULL, false); lf = xstrdup (con->target); xfree (con->target); con->target = old_target; if (err == RETROK) { *f = ftp_parse_ls (lf, con->rs); if (opt.remove_listing) { if (unlink (lf)) logprintf (LOG_NOTQUIET, "unlink: %s\n", strerror (errno)); else logprintf (LOG_VERBOSE, _("Removed %s.\n"), quote (lf)); } } else *f = NULL; xfree (lf); con->cmd &= ~DO_LIST; return err; }
126,315,655,955,091,890,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,900
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_loop (struct url *u, char **local_file, int *dt, struct url *proxy, bool recursive, bool glob) { ccon con; /* FTP connection */ uerr_t res; *dt = 0; xzero (con); con.csock = -1; con.st = ON_YOUR_OWN; con.rs = ST_UNIX; con.id = NULL; con.proxy = proxy; /* If the file name is empty, the user probably wants a directory index. We'll provide one, properly HTML-ized. Unless opt.htmlify is 0, of course. :-) */ if (!*u->file && !recursive) { struct fileinfo *f; res = ftp_get_listing (u, &con, &f); if (res == RETROK) { if (opt.htmlify && !opt.spider) { char *filename = (opt.output_document ? xstrdup (opt.output_document) : (con.target ? xstrdup (con.target) : url_file_name (u, NULL))); res = ftp_index (filename, u, f); if (res == FTPOK && opt.verbose) { if (!opt.output_document) { struct_stat st; wgint sz; if (stat (filename, &st) == 0) sz = st.st_size; else sz = -1; logprintf (LOG_NOTQUIET, _("Wrote HTML-ized index to %s [%s].\n"), quote (filename), number_to_static_string (sz)); } else logprintf (LOG_NOTQUIET, _("Wrote HTML-ized index to %s.\n"), quote (filename)); } xfree (filename); } freefileinfo (f); } } else { bool ispattern = false; if (glob) { /* Treat the URL as a pattern if the file name part of the URL path contains wildcards. (Don't check for u->file because it is unescaped and therefore doesn't leave users the option to escape literal '*' as %2A.) */ char *file_part = strrchr (u->path, '/'); if (!file_part) file_part = u->path; ispattern = has_wildcards_p (file_part); } if (ispattern || recursive || opt.timestamping || opt.preserve_perm) { /* ftp_retrieve_glob is a catch-all function that gets called if we need globbing, time-stamping, recursion or preserve permissions. Its third argument is just what we really need. */ res = ftp_retrieve_glob (u, &con, ispattern ? GLOB_GLOBALL : GLOB_GETONE); } else res = ftp_loop_internal (u, NULL, &con, local_file, false); } if (res == FTPOK) res = RETROK; if (res == RETROK) *dt |= RETROKF; /* If a connection was left, quench it. */ if (con.csock != -1) fd_close (con.csock); xfree (con.id); xfree (con.target); return res; }
124,529,080,091,379,940,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,901
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con, char **local_file, bool force_full_retrieve) { int count, orig_lp; wgint restval, len = 0, qtyread = 0; char *tms, *locf; const char *tmrate = NULL; uerr_t err; struct_stat st; /* Declare WARC variables. */ bool warc_enabled = (opt.warc_filename != NULL); FILE *warc_tmp = NULL; ip_address *warc_ip = NULL; wgint last_expected_bytes = 0; /* Get the target, and set the name for the message accordingly. */ if ((f == NULL) && (con->target)) { /* Explicit file (like ".listing"). */ locf = con->target; } else { /* URL-derived file. Consider "-O file" name. */ xfree (con->target); con->target = url_file_name (u, NULL); if (!opt.output_document) locf = con->target; else locf = opt.output_document; } /* If the output_document was given, then this check was already done and the file didn't exist. Hence the !opt.output_document */ /* If we receive .listing file it is necessary to determine system type of the ftp server even if opn.noclobber is given. Thus we must ignore opt.noclobber in order to establish connection with the server and get system type. */ if (opt.noclobber && !opt.output_document && file_exists_p (con->target) && !((con->cmd & DO_LIST) && !(con->cmd & DO_RETR))) { logprintf (LOG_VERBOSE, _("File %s already there; not retrieving.\n"), quote (con->target)); /* If the file is there, we suppose it's retrieved OK. */ return RETROK; } /* Remove it if it's a link. */ remove_link (con->target); count = 0; if (con->st & ON_YOUR_OWN) con->st = ON_YOUR_OWN; orig_lp = con->cmd & LEAVE_PENDING ? 1 : 0; /* THE loop. */ do { /* Increment the pass counter. */ ++count; sleep_between_retrievals (count); if (con->st & ON_YOUR_OWN) { con->cmd = 0; con->cmd |= (DO_RETR | LEAVE_PENDING); if (con->csock != -1) con->cmd &= ~ (DO_LOGIN | DO_CWD); else con->cmd |= (DO_LOGIN | DO_CWD); } else /* not on your own */ { if (con->csock != -1) con->cmd &= ~DO_LOGIN; else con->cmd |= DO_LOGIN; if (con->st & DONE_CWD) con->cmd &= ~DO_CWD; else con->cmd |= DO_CWD; } /* For file RETR requests, we can write a WARC record. We record the file contents to a temporary file. */ if (warc_enabled && (con->cmd & DO_RETR) && warc_tmp == NULL) { warc_tmp = warc_tempfile (); if (warc_tmp == NULL) return WARC_TMP_FOPENERR; if (!con->proxy && con->csock != -1) { warc_ip = (ip_address *) alloca (sizeof (ip_address)); socket_ip_address (con->csock, warc_ip, ENDPOINT_PEER); } } /* Decide whether or not to restart. */ if (con->cmd & DO_LIST) restval = 0; else if (force_full_retrieve) restval = 0; else if (opt.start_pos >= 0) restval = opt.start_pos; else if (opt.always_rest && stat (locf, &st) == 0 && S_ISREG (st.st_mode)) /* When -c is used, continue from on-disk size. (Can't use hstat.len even if count>1 because we don't want a failed first attempt to clobber existing data.) */ restval = st.st_size; else if (count > 1) restval = qtyread; /* start where the previous run left off */ else restval = 0; /* Get the current time string. */ tms = datetime_str (time (NULL)); /* Print fetch message, if opt.verbose. */ if (opt.verbose) { char *hurl = url_string (u, URL_AUTH_HIDE_PASSWD); char tmp[256]; strcpy (tmp, " "); if (count > 1) sprintf (tmp, _("(try:%2d)"), count); logprintf (LOG_VERBOSE, "--%s-- %s\n %s => %s\n", tms, hurl, tmp, quote (locf)); #ifdef WINDOWS ws_changetitle (hurl); #endif xfree (hurl); } /* Send getftp the proper length, if fileinfo was provided. */ if (f && f->type != FT_SYMLINK) len = f->size; else len = 0; /* If we are working on a WARC record, getftp should also write to the warc_tmp file. */ err = getftp (u, len, &qtyread, restval, con, count, &last_expected_bytes, warc_tmp); if (con->csock == -1) con->st &= ~DONE_CWD; else con->st |= DONE_CWD; switch (err) { case HOSTERR: case CONIMPOSSIBLE: case FWRITEERR: case FOPENERR: case FTPNSFOD: case FTPLOGINC: case FTPNOPASV: case CONTNOTSUPPORTED: case UNLINKERR: case WARC_TMP_FWRITEERR: /* Fatal errors, give up. */ if (warc_tmp != NULL) fclose (warc_tmp); return err; case CONSOCKERR: case CONERROR: case FTPSRVERR: case FTPRERR: case WRITEFAILED: case FTPUNKNOWNTYPE: case FTPSYSERR: case FTPPORTERR: case FTPLOGREFUSED: case FTPINVPASV: case FOPEN_EXCL_ERR: printwhat (count, opt.ntry); /* non-fatal errors */ if (err == FOPEN_EXCL_ERR) { /* Re-determine the file name. */ xfree (con->target); con->target = url_file_name (u, NULL); locf = con->target; } continue; case FTPRETRINT: /* If the control connection was closed, the retrieval will be considered OK if f->size == len. */ if (!f || qtyread != f->size) { printwhat (count, opt.ntry); continue; } break; case RETRFINISHED: /* Great! */ break; default: /* Not as great. */ abort (); } tms = datetime_str (time (NULL)); if (!opt.spider) tmrate = retr_rate (qtyread - restval, con->dltime); /* If we get out of the switch above without continue'ing, we've successfully downloaded a file. Remember this fact. */ downloaded_file (FILE_DOWNLOADED_NORMALLY, locf); if (con->st & ON_YOUR_OWN) { fd_close (con->csock); con->csock = -1; } if (!opt.spider) { bool write_to_stdout = (opt.output_document && HYPHENP (opt.output_document)); logprintf (LOG_VERBOSE, write_to_stdout ? _("%s (%s) - written to stdout %s[%s]\n\n") : _("%s (%s) - %s saved [%s]\n\n"), tms, tmrate, write_to_stdout ? "" : quote (locf), number_to_static_string (qtyread)); } if (!opt.verbose && !opt.quiet) { /* Need to hide the password from the URL. The `if' is here so that we don't do the needless allocation every time. */ char *hurl = url_string (u, URL_AUTH_HIDE_PASSWD); logprintf (LOG_NONVERBOSE, "%s URL: %s [%s] -> \"%s\" [%d]\n", tms, hurl, number_to_static_string (qtyread), locf, count); xfree (hurl); } if (warc_enabled && (con->cmd & DO_RETR)) { /* Create and store a WARC resource record for the retrieved file. */ bool warc_res; warc_res = warc_write_resource_record (NULL, u->url, NULL, NULL, warc_ip, NULL, warc_tmp, -1); if (! warc_res) return WARC_ERR; /* warc_write_resource_record has also closed warc_tmp. */ warc_tmp = NULL; } if (con->cmd & DO_LIST) /* This is a directory listing file. */ { if (!opt.remove_listing) /* --dont-remove-listing was specified, so do count this towards the number of bytes and files downloaded. */ { total_downloaded_bytes += qtyread; numurls++; } /* Deletion of listing files is not controlled by --delete-after, but by the more specific option --dont-remove-listing, and the code to do this deletion is in another function. */ } else if (!opt.spider) /* This is not a directory listing file. */ { /* Unlike directory listing files, don't pretend normal files weren't downloaded if they're going to be deleted. People seeding proxies, for instance, may want to know how many bytes and files they've downloaded through it. */ total_downloaded_bytes += qtyread; numurls++; if (opt.delete_after && !input_file_url (opt.input_filename)) { DEBUGP (("\ Removing file due to --delete-after in ftp_loop_internal():\n")); logprintf (LOG_VERBOSE, _("Removing %s.\n"), locf); if (unlink (locf)) logprintf (LOG_NOTQUIET, "unlink: %s\n", strerror (errno)); } } /* Restore the original leave-pendingness. */ if (orig_lp) con->cmd |= LEAVE_PENDING; else con->cmd &= ~LEAVE_PENDING; if (local_file) *local_file = xstrdup (locf); if (warc_tmp != NULL) fclose (warc_tmp); return RETROK; } while (!opt.ntry || (count < opt.ntry)); if (con->csock != -1 && (con->st & ON_YOUR_OWN)) { fd_close (con->csock); con->csock = -1; } if (warc_tmp != NULL) fclose (warc_tmp); return TRYLIMEXC; }
236,599,843,773,130,360,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,902
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_retrieve_dirs (struct url *u, struct fileinfo *f, ccon *con) { char *container = NULL; int container_size = 0; for (; f; f = f->next) { int size; char *odir, *newdir; if (opt.quota && total_downloaded_bytes > opt.quota) break; if (f->type != FT_DIRECTORY) continue; /* Allocate u->dir off stack, but reallocate only if a larger string is needed. It's a pity there's no "realloca" for an item on the bottom of the stack. */ size = strlen (u->dir) + 1 + strlen (f->name) + 1; if (size > container_size) container = (char *)alloca (size); newdir = container; odir = u->dir; if (*odir == '\0' || (*odir == '/' && *(odir + 1) == '\0')) /* If ODIR is empty or just "/", simply append f->name to ODIR. (In the former case, to preserve u->dir being relative; in the latter case, to avoid double slash.) */ sprintf (newdir, "%s%s", odir, f->name); else /* Else, use a separator. */ sprintf (newdir, "%s/%s", odir, f->name); DEBUGP (("Composing new CWD relative to the initial directory.\n")); DEBUGP ((" odir = '%s'\n f->name = '%s'\n newdir = '%s'\n\n", odir, f->name, newdir)); if (!accdir (newdir)) { logprintf (LOG_VERBOSE, _("\ Not descending to %s as it is excluded/not-included.\n"), quote (newdir)); continue; } con->st &= ~DONE_CWD; odir = xstrdup (u->dir); /* because url_set_dir will free u->dir. */ url_set_dir (u, newdir); ftp_retrieve_glob (u, con, GLOB_GETALL); url_set_dir (u, odir); xfree (odir); /* Set the time-stamp? */ } if (opt.quota && total_downloaded_bytes > opt.quota) return QUOTEXC; else return RETROK; }
319,183,586,292,658,200,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,903
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_retrieve_glob (struct url *u, ccon *con, int action) { struct fileinfo *f, *start; uerr_t res; con->cmd |= LEAVE_PENDING; res = ftp_get_listing (u, con, &start); if (res != RETROK) return res; /* First: weed out that do not conform the global rules given in opt.accepts and opt.rejects. */ if (opt.accepts || opt.rejects) { f = start; while (f) { if (f->type != FT_DIRECTORY && !acceptable (f->name)) { logprintf (LOG_VERBOSE, _("Rejecting %s.\n"), quote (f->name)); f = delelement (f, &start); } else f = f->next; } } /* Remove all files with possible harmful names or invalid entries. */ f = start; while (f) { if (has_insecure_name_p (f->name) || is_invalid_entry (f)) { logprintf (LOG_VERBOSE, _("Rejecting %s.\n"), quote (f->name)); f = delelement (f, &start); } else f = f->next; } /* Now weed out the files that do not match our globbing pattern. If we are dealing with a globbing pattern, that is. */ if (*u->file) { if (action == GLOB_GLOBALL) { int (*matcher) (const char *, const char *, int) = opt.ignore_case ? fnmatch_nocase : fnmatch; int matchres = 0; f = start; while (f) { matchres = matcher (u->file, f->name, 0); if (matchres == -1) { logprintf (LOG_NOTQUIET, _("Error matching %s against %s: %s\n"), u->file, quotearg_style (escape_quoting_style, f->name), strerror (errno)); break; } if (matchres == FNM_NOMATCH) f = delelement (f, &start); /* delete the element from the list */ else f = f->next; /* leave the element in the list */ } if (matchres == -1) { freefileinfo (start); return RETRBADPATTERN; } } else if (action == GLOB_GETONE) { #ifdef __VMS /* 2009-09-09 SMS. * Odd-ball compiler ("HP C V7.3-009 on OpenVMS Alpha V7.3-2") * bug causes spurious %CC-E-BADCONDIT complaint with this * "?:" statement. (Different linkage attributes for strcmp() * and strcasecmp().) Converting to "if" changes the * complaint to %CC-W-PTRMISMATCH on "cmp = strcmp;". Adding * the senseless type cast clears the complaint, and looks * harmless. */ int (*cmp) (const char *, const char *) = opt.ignore_case ? strcasecmp : (int (*)())strcmp; #else /* def __VMS */ int (*cmp) (const char *, const char *) = opt.ignore_case ? strcasecmp : strcmp; #endif /* def __VMS [else] */ f = start; while (f) { if (0 != cmp(u->file, f->name)) f = delelement (f, &start); else f = f->next; } } } if (start) { /* Just get everything. */ res = ftp_retrieve_list (u, start, con); } else { if (action == GLOB_GLOBALL) { /* No luck. */ /* #### This message SUCKS. We should see what was the reason that nothing was retrieved. */ logprintf (LOG_VERBOSE, _("No matches on pattern %s.\n"), quote (u->file)); } else if (action == GLOB_GETONE) /* GLOB_GETONE or GLOB_GETALL */ { /* Let's try retrieving it anyway. */ con->st |= ON_YOUR_OWN; res = ftp_loop_internal (u, NULL, con, NULL, false); return res; } /* If action == GLOB_GETALL, and the file list is empty, there's no point in trying to download anything or in complaining about it. (An empty directory should not cause complaints.) */ } freefileinfo (start); if (opt.quota && total_downloaded_bytes > opt.quota) return QUOTEXC; else return res; }
45,365,460,528,071,730,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,904
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
ftp_retrieve_list (struct url *u, struct fileinfo *f, ccon *con) { static int depth = 0; uerr_t err; struct fileinfo *orig; wgint local_size; time_t tml; bool dlthis; /* Download this (file). */ const char *actual_target = NULL; bool force_full_retrieve = false; /* Increase the depth. */ ++depth; if (opt.reclevel != INFINITE_RECURSION && depth > opt.reclevel) { DEBUGP ((_("Recursion depth %d exceeded max. depth %d.\n"), depth, opt.reclevel)); --depth; return RECLEVELEXC; } assert (f != NULL); orig = f; con->st &= ~ON_YOUR_OWN; if (!(con->st & DONE_CWD)) con->cmd |= DO_CWD; else con->cmd &= ~DO_CWD; con->cmd |= (DO_RETR | LEAVE_PENDING); if (con->csock < 0) con->cmd |= DO_LOGIN; else con->cmd &= ~DO_LOGIN; err = RETROK; /* in case it's not used */ while (f) { char *old_target, *ofile; if (opt.quota && total_downloaded_bytes > opt.quota) { --depth; return QUOTEXC; } old_target = con->target; ofile = xstrdup (u->file); url_set_file (u, f->name); con->target = url_file_name (u, NULL); err = RETROK; dlthis = true; if (opt.timestamping && f->type == FT_PLAINFILE) { struct_stat st; /* If conversion of HTML files retrieved via FTP is ever implemented, we'll need to stat() <file>.orig here when -K has been specified. I'm not implementing it now since files on an FTP server are much more likely than files on an HTTP server to legitimately have a .orig suffix. */ if (!stat (con->target, &st)) { bool eq_size; bool cor_val; /* Else, get it from the file. */ local_size = st.st_size; tml = st.st_mtime; #ifdef WINDOWS /* Modification time granularity is 2 seconds for Windows, so increase local time by 1 second for later comparison. */ tml++; #endif /* Compare file sizes only for servers that tell us correct values. Assume sizes being equal for servers that lie about file size. */ cor_val = (con->rs == ST_UNIX || con->rs == ST_WINNT); eq_size = cor_val ? (local_size == f->size) : true; if (f->tstamp <= tml && eq_size) { /* Remote file is older, file sizes can be compared and are both equal. */ logprintf (LOG_VERBOSE, _("\ Remote file no newer than local file %s -- not retrieving.\n"), quote (con->target)); dlthis = false; } else if (f->tstamp > tml) { /* Remote file is newer */ force_full_retrieve = true; logprintf (LOG_VERBOSE, _("\ Remote file is newer than local file %s -- retrieving.\n\n"), quote (con->target)); } else { /* Sizes do not match */ logprintf (LOG_VERBOSE, _("\ The sizes do not match (local %s) -- retrieving.\n\n"), number_to_static_string (local_size)); } } } /* opt.timestamping && f->type == FT_PLAINFILE */ switch (f->type) { case FT_SYMLINK: /* If opt.retr_symlinks is defined, we treat symlinks as if they were normal files. There is currently no way to distinguish whether they might be directories, and follow them. */ if (!opt.retr_symlinks) { #ifdef HAVE_SYMLINK if (!f->linkto) logputs (LOG_NOTQUIET, _("Invalid name of the symlink, skipping.\n")); else { struct_stat st; /* Check whether we already have the correct symbolic link. */ int rc = lstat (con->target, &st); if (rc == 0) { size_t len = strlen (f->linkto) + 1; if (S_ISLNK (st.st_mode)) { char *link_target = (char *)alloca (len); size_t n = readlink (con->target, link_target, len); if ((n == len - 1) && (memcmp (link_target, f->linkto, n) == 0)) { logprintf (LOG_VERBOSE, _("\ Already have correct symlink %s -> %s\n\n"), quote (con->target), quote (f->linkto)); dlthis = false; break; } } } logprintf (LOG_VERBOSE, _("Creating symlink %s -> %s\n"), quote (con->target), quote (f->linkto)); /* Unlink before creating symlink! */ unlink (con->target); if (symlink (f->linkto, con->target) == -1) logprintf (LOG_NOTQUIET, "symlink: %s\n", strerror (errno)); logputs (LOG_VERBOSE, "\n"); } /* have f->linkto */ #else /* not HAVE_SYMLINK */ logprintf (LOG_NOTQUIET, _("Symlinks not supported, skipping symlink %s.\n"), quote (con->target)); #endif /* not HAVE_SYMLINK */ } else /* opt.retr_symlinks */ { if (dlthis) err = ftp_loop_internal (u, f, con, NULL, force_full_retrieve); } /* opt.retr_symlinks */ break; case FT_DIRECTORY: if (!opt.recursive) logprintf (LOG_NOTQUIET, _("Skipping directory %s.\n"), quote (f->name)); break; case FT_PLAINFILE: /* Call the retrieve loop. */ if (dlthis) err = ftp_loop_internal (u, f, con, NULL, force_full_retrieve); break; case FT_UNKNOWN: logprintf (LOG_NOTQUIET, _("%s: unknown/unsupported file type.\n"), quote (f->name)); break; } /* switch */ /* 2004-12-15 SMS. * Set permissions _before_ setting the times, as setting the * permissions changes the modified-time, at least on VMS. * Also, use the opt.output_document name here, too, as * appropriate. (Do the test once, and save the result.) */ set_local_file (&actual_target, con->target); /* If downloading a plain file, and the user requested it, then set valid (non-zero) permissions. */ if (dlthis && (actual_target != NULL) && (f->type == FT_PLAINFILE) && opt.preserve_perm) { if (f->perms) chmod (actual_target, f->perms); else DEBUGP (("Unrecognized permissions for %s.\n", actual_target)); } /* Set the time-stamp information to the local file. Symlinks are not to be stamped because it sets the stamp on the original. :( */ if (actual_target != NULL) { if (opt.useservertimestamps && !(f->type == FT_SYMLINK && !opt.retr_symlinks) && f->tstamp != -1 && dlthis && file_exists_p (con->target)) { touch (actual_target, f->tstamp); } else if (f->tstamp == -1) logprintf (LOG_NOTQUIET, _("%s: corrupt time-stamp.\n"), actual_target); } xfree (con->target); con->target = old_target; url_set_file (u, ofile); xfree (ofile); /* Break on fatals. */ if (err == QUOTEXC || err == HOSTERR || err == FWRITEERR || err == WARC_ERR || err == WARC_TMP_FOPENERR || err == WARC_TMP_FWRITEERR) break; con->cmd &= ~ (DO_CWD | DO_LOGIN); f = f->next; } /* We do not want to call ftp_retrieve_dirs here */ if (opt.recursive && !(opt.reclevel != INFINITE_RECURSION && depth >= opt.reclevel)) err = ftp_retrieve_dirs (u, orig, con); else if (opt.recursive) DEBUGP ((_("Will not retrieve dirs since depth is %d (max %d).\n"), depth, opt.reclevel)); --depth; return err; }
31,859,296,699,574,410,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,905
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
has_insecure_name_p (const char *s) { if (*s == '/') return true; if (strstr (s, "../") != 0) return true; return false; }
219,673,299,327,885,470,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,906
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
is_invalid_entry (struct fileinfo *f) { struct fileinfo *cur = f; char *f_name = f->name; /* If the node we're currently checking has a duplicate later, we eliminate * the current node and leave the next one intact. */ while (cur->next) { cur = cur->next; if (strcmp(f_name, cur->name) == 0) return true; } return false; }
137,291,254,496,510,400,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
10,907
savannah
075d7556964f5a871a73c22ac4b69f5361295099
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/wget.git/commit/?id=075d7556964f5a871a73c22ac4b69f5361295099
None
0
print_length (wgint size, wgint start, bool authoritative) { logprintf (LOG_VERBOSE, _("Length: %s"), number_to_static_string (size)); if (size >= 1024) logprintf (LOG_VERBOSE, " (%s)", human_readable (size, 10, 1)); if (start > 0) { if (size - start >= 1024) logprintf (LOG_VERBOSE, _(", %s (%s) remaining"), number_to_static_string (size - start), human_readable (size - start, 10, 1)); else logprintf (LOG_VERBOSE, _(", %s remaining"), number_to_static_string (size - start)); } logputs (LOG_VERBOSE, !authoritative ? _(" (unauthoritative)\n") : "\n"); }
115,651,917,033,130,680,000,000,000,000,000,000,000
None
null
[ "CWE-200" ]
CVE-2015-7665
Tails before 1.7 includes the wget program but does not prevent automatic fallback from passive FTP to active FTP, which allows remote FTP servers to discover the Tor client IP address by reading a (1) PORT or (2) EPRT command. NOTE: within wget itself, the automatic fallback is not considered a vulnerability by CVE.
https://nvd.nist.gov/vuln/detail/CVE-2015-7665
11,095
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
add_mrange(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *out, int len) { int out_pos; if (cmap->dlen + len + 1 > cmap->dcap) { int new_cap = cmap->dcap ? cmap->dcap * 2 : 256; cmap->dict = fz_resize_array(ctx, cmap->dict, new_cap, sizeof *cmap->dict); cmap->dcap = new_cap; } out_pos = cmap->dlen; cmap->dict[out_pos] = len; memcpy(&cmap->dict[out_pos+1], out, sizeof(int)*len); cmap->dlen += len + 1; add_range(ctx, cmap, low, low, out_pos, 1, 1); }
245,120,723,377,082,040,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,096
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
check_splay(cmap_splay *tree, unsigned int node, int depth) { if (node == EMPTY) return; assert(tree[node].parent == EMPTY); walk_splay(tree, node, do_check, tree); }
262,420,811,719,345,370,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,097
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
copy_node_types(cmap_splay *node, void *arg) { pdf_cmap *cmap = (pdf_cmap *)arg; if (node->many) { assert(node->low == node->high); cmap->mranges[cmap->mlen].low = node->low; cmap->mranges[cmap->mlen].out = node->out; cmap->mlen++; } else if (node->low <= 0xffff && node->high <= 0xFFFF && node->out <= 0xFFFF) { cmap->ranges[cmap->rlen].low = node->low; cmap->ranges[cmap->rlen].high = node->high; cmap->ranges[cmap->rlen].out = node->out; cmap->rlen++; } else { cmap->xranges[cmap->xlen].low = node->low; cmap->xranges[cmap->xlen].high = node->high; cmap->xranges[cmap->xlen].out = node->out; cmap->xlen++; } }
280,744,279,127,383,330,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,098
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
count_node_types(cmap_splay *node, void *arg) { int *counts = (int *)arg; if (node->many) counts[2]++; else if (node->low <= 0xffff && node->high <= 0xFFFF && node->out <= 0xFFFF) counts[0]++; else counts[1]++; }
119,504,487,091,456,050,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,099
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
static unsigned int delete_node(pdf_cmap *cmap, unsigned int current) { cmap_splay *tree = cmap->tree; unsigned int parent; unsigned int replacement; assert(current != EMPTY); parent = tree[current].parent; if (tree[current].right == EMPTY) { if (parent == EMPTY) { replacement = cmap->ttop = tree[current].left; } else if (tree[parent].left == current) { replacement = tree[parent].left = tree[current].left; } else { assert(tree[parent].right == current); replacement = tree[parent].right = tree[current].left; } if (replacement != EMPTY) tree[replacement].parent = parent; else replacement = parent; } else if (tree[current].left == EMPTY) { if (parent == EMPTY) { replacement = cmap->ttop = tree[current].right; } else if (tree[parent].left == current) { replacement = tree[parent].left = tree[current].right; } else { assert(tree[parent].right == current); replacement = tree[parent].right = tree[current].right; } if (replacement != EMPTY) tree[replacement].parent = parent; else replacement = parent; } else { /* Hard case, find the in-order predecessor of current */ int amputee = current; replacement = tree[current].left; while (tree[replacement].right != EMPTY) { amputee = replacement; replacement = tree[replacement].right; } /* Remove replacement from the tree */ if (amputee == current) { tree[amputee].left = tree[replacement].left; if (tree[amputee].left != EMPTY) tree[tree[amputee].left].parent = amputee; } else { tree[amputee].right = tree[replacement].left; if (tree[amputee].right != EMPTY) tree[tree[amputee].right].parent = amputee; } /* Insert replacement in place of current */ tree[replacement].parent = parent; if (parent == EMPTY) { tree[replacement].parent = EMPTY; cmap->ttop = replacement; } else if (tree[parent].left == current) tree[parent].left = replacement; else { assert(tree[parent].right == current); tree[parent].right = replacement; } tree[replacement].left = tree[current].left; if (tree[replacement].left != EMPTY) tree[tree[replacement].left].parent = replacement; tree[replacement].right = tree[current].right; if (tree[replacement].right != EMPTY) tree[tree[replacement].right].parent = replacement; } /* current is now unlinked. We need to remove it from our array. */ cmap->tlen--; if (current != cmap->tlen) { if (replacement == cmap->tlen) replacement = current; tree[current] = tree[cmap->tlen]; parent = tree[current].parent; if (parent == EMPTY) cmap->ttop = current; else if (tree[parent].left == cmap->tlen) tree[parent].left = current; else { assert(tree[parent].right == cmap->tlen); tree[parent].right = current; } if (tree[current].left != EMPTY) { assert(tree[tree[current].left].parent == cmap->tlen); tree[tree[current].left].parent = current; } if (tree[current].right != EMPTY) { assert(tree[tree[current].right].parent == cmap->tlen); tree[tree[current].right].parent = current; } } /* Return the node that we should continue searching from */ return replacement; }
313,425,205,842,121,000,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,100
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
do_check(cmap_splay *node, void *arg) { cmap_splay *tree = arg; unsigned int num = node - tree; assert(!node->many || node->low == node->high); assert(node->low <= node->high); assert((node->left == EMPTY) || (tree[node->left].parent == num && tree[node->left].high < node->low)); assert(node->right == EMPTY || (tree[node->right].parent == num && node->high < tree[node->right].low)); }
309,859,418,446,105,700,000,000,000,000,000,000,000
pdf-cmap.c
279,450,288,346,046,480,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,101
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
dump_splay(cmap_splay *tree, unsigned int node, int depth, const char *pre) { int i; if (node == EMPTY) return; for (i = 0; i < depth; i++) fprintf(stderr, " "); fprintf(stderr, "%s%d:", pre, node); if (tree[node].parent == EMPTY) fprintf(stderr, "^EMPTY"); else fprintf(stderr, "^%d", tree[node].parent); if (tree[node].left == EMPTY) fprintf(stderr, "<EMPTY"); else fprintf(stderr, "<%d", tree[node].left); if (tree[node].right == EMPTY) fprintf(stderr, ">EMPTY"); else fprintf(stderr, ">%d", tree[node].right); fprintf(stderr, "(%x,%x,%x,%d)\n", tree[node].low, tree[node].high, tree[node].out, tree[node].many); assert(tree[node].parent == EMPTY || depth); assert(tree[node].left == EMPTY || tree[tree[node].left].parent == node); assert(tree[node].right == EMPTY || tree[tree[node].right].parent == node); dump_splay(tree, tree[node].left, depth+1, "L"); dump_splay(tree, tree[node].right, depth+1, "R"); }
239,325,017,151,051,500,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,102
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
move_to_root(cmap_splay *tree, unsigned int x) { if (x == EMPTY) return; do { unsigned int z, zp; unsigned int y = tree[x].parent; if (y == EMPTY) break; z = tree[y].parent; if (z == EMPTY) { /* Case 3 */ tree[x].parent = EMPTY; tree[y].parent = x; if (tree[y].left == x) { /* Case 3 */ tree[y].left = tree[x].right; if (tree[y].left != EMPTY) tree[tree[y].left].parent = y; tree[x].right = y; } else { /* Case 3 - reflected */ assert(tree[y].right == x); tree[y].right = tree[x].left; if (tree[y].right != EMPTY) tree[tree[y].right].parent = y; tree[x].left = y; } break; } zp = tree[z].parent; tree[x].parent = zp; if (zp != EMPTY) { if (tree[zp].left == z) tree[zp].left = x; else { assert(tree[zp].right == z); tree[zp].right = x; } } tree[y].parent = x; if (tree[y].left == x) { tree[y].left = tree[x].right; if (tree[y].left != EMPTY) tree[tree[y].left].parent = y; tree[x].right = y; if (tree[z].left == y) { /* Case 1 */ tree[z].parent = y; tree[z].left = tree[y].right; if (tree[z].left != EMPTY) tree[tree[z].left].parent = z; tree[y].right = z; } else { /* Case 2 - reflected */ assert(tree[z].right == y); tree[z].parent = x; tree[z].right = tree[x].left; if (tree[z].right != EMPTY) tree[tree[z].right].parent = z; tree[x].left = z; } } else { assert(tree[y].right == x); tree[y].right = tree[x].left; if (tree[y].right != EMPTY) tree[tree[y].right].parent = y; tree[x].left = y; if (tree[z].left == y) { /* Case 2 */ tree[z].parent = x; tree[z].left = tree[x].right; if (tree[z].left != EMPTY) tree[tree[z].left].parent = z; tree[x].right = z; } else { /* Case 1 - reflected */ assert(tree[z].right == y); tree[z].parent = y; tree[z].right = tree[y].left; if (tree[z].right != EMPTY) tree[tree[z].right].parent = z; tree[y].left = z; } } } while (1); }
102,683,482,583,186,010,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,103
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int n) { if (cmap->codespace_len + 1 == nelem(cmap->codespace)) { fz_warn(ctx, "assert: too many code space ranges"); return; } cmap->codespace[cmap->codespace_len].n = n; cmap->codespace[cmap->codespace_len].low = low; cmap->codespace[cmap->codespace_len].high = high; cmap->codespace_len ++; }
226,413,261,127,163,300,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,104
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap) { return cmap->wmode; }
17,045,354,751,123,713,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,105
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, unsigned char *end, unsigned int *cpt) { unsigned int c; int k, n; int len = end - buf; if (len > 4) len = 4; c = 0; for (n = 0; n < len; n++) { c = (c << 8) | buf[n]; for (k = 0; k < cmap->codespace_len; k++) { if (cmap->codespace[k].n == n + 1) { if (c >= cmap->codespace[k].low && c <= cmap->codespace[k].high) { *cpt = c; return n + 1; } } } } *cpt = 0; return 1; }
294,614,808,202,277,150,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,106
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap) { fz_drop_storable(ctx, &cmap->storable); }
106,423,036,151,926,960,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,107
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_drop_cmap_imp(fz_context *ctx, fz_storable *cmap_) { pdf_cmap *cmap = (pdf_cmap *)cmap_; pdf_drop_cmap(ctx, cmap->usecmap); fz_free(ctx, cmap->ranges); fz_free(ctx, cmap->xranges); fz_free(ctx, cmap->mranges); fz_free(ctx, cmap->dict); fz_free(ctx, cmap->tree); fz_free(ctx, cmap); }
5,219,694,418,050,346,400,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,108
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap) { return fz_keep_storable(ctx, &cmap->storable); }
280,184,611,007,150,270,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,109
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt) { pdf_range *ranges = cmap->ranges; pdf_xrange *xranges = cmap->xranges; int l, r, m; l = 0; r = cmap->rlen - 1; while (l <= r) { m = (l + r) >> 1; if (cpt < ranges[m].low) r = m - 1; else if (cpt > ranges[m].high) l = m + 1; else return cpt - ranges[m].low + ranges[m].out; } l = 0; r = cmap->xlen - 1; while (l <= r) { m = (l + r) >> 1; if (cpt < xranges[m].low) r = m - 1; else if (cpt > xranges[m].high) l = m + 1; else return cpt - xranges[m].low + xranges[m].out; } if (cmap->usecmap) return pdf_lookup_cmap(cmap->usecmap, cpt); return -1; }
1,103,081,474,390,576,500,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,110
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out) { pdf_range *ranges = cmap->ranges; pdf_xrange *xranges = cmap->xranges; pdf_mrange *mranges = cmap->mranges; unsigned int i; int l, r, m; l = 0; r = cmap->rlen - 1; while (l <= r) { m = (l + r) >> 1; if (cpt < ranges[m].low) r = m - 1; else if (cpt > ranges[m].high) l = m + 1; else { out[0] = cpt - ranges[m].low + ranges[m].out; return 1; } } l = 0; r = cmap->xlen - 1; while (l <= r) { m = (l + r) >> 1; if (cpt < xranges[m].low) r = m - 1; else if (cpt > xranges[m].high) l = m + 1; else { out[0] = cpt - xranges[m].low + xranges[m].out; return 1; } } l = 0; r = cmap->mlen - 1; while (l <= r) { m = (l + r) >> 1; if (cpt < mranges[m].low) r = m - 1; else if (cpt > mranges[m].low) l = m + 1; else { int *ptr = &cmap->dict[cmap->mranges[m].out]; unsigned int len = (unsigned int)*ptr++; for (i = 0; i < len; ++i) out[i] = *ptr++; return len; } } if (cmap->usecmap) return pdf_lookup_cmap_full(cmap->usecmap, cpt, out); return 0; }
145,179,250,570,449,800,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,111
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *values, int len) { if (len == 1) { add_range(ctx, cmap, low, low, values[0], 1, 0); return; } /* Decode unicode surrogate pairs. */ /* Only the *-UCS2 CMaps use one-to-many mappings, so assuming unicode should be safe. */ if (len == 2 && values[0] >= 0xD800 && values[0] <= 0xDBFF && values[1] >= 0xDC00 && values[1] <= 0xDFFF) { int rune = ((values[0] - 0xD800) << 10) + (values[1] - 0xDC00) + 0x10000; add_range(ctx, cmap, low, low, rune, 1, 0); return; } if (len > PDF_MRANGE_CAP) { fz_warn(ctx, "ignoring one to many mapping in cmap %s", cmap->cmap_name); return; } add_mrange(ctx, cmap, low, values, len); }
151,275,068,419,370,070,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,112
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int out) { add_range(ctx, cmap, low, high, out, 1, 0); }
180,095,435,423,895,770,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,113
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_new_cmap(fz_context *ctx) { pdf_cmap *cmap = fz_malloc_struct(ctx, pdf_cmap); FZ_INIT_STORABLE(cmap, 1, pdf_drop_cmap_imp); return cmap; }
30,786,992,688,510,970,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,114
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap) { int i; pdf_drop_cmap(ctx, cmap->usecmap); cmap->usecmap = pdf_keep_cmap(ctx, usecmap); if (cmap->codespace_len == 0) { cmap->codespace_len = usecmap->codespace_len; for (i = 0; i < usecmap->codespace_len; i++) cmap->codespace[i] = usecmap->codespace[i]; } }
71,641,778,282,825,090,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,115
ghostscript
f597300439e62f5e921f0d7b1e880b5c1a1f1607
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=f597300439e62f5e921f0d7b1e880b5c1a1f1607;hp=093fc3b098dc5fadef5d8ad4b225db9fb124758b
None
0
pdf_sort_cmap(fz_context *ctx, pdf_cmap *cmap) { int counts[3]; if (cmap->tree == NULL) return; counts[0] = 0; counts[1] = 0; counts[2] = 0; walk_splay(cmap->tree, cmap->ttop, count_node_types, &counts); cmap->ranges = fz_malloc_array(ctx, counts[0], sizeof(*cmap->ranges)); cmap->rcap = counts[0]; cmap->xranges = fz_malloc_array(ctx, counts[1], sizeof(*cmap->xranges)); cmap->xcap = counts[1]; cmap->mranges = fz_malloc_array(ctx, counts[2], sizeof(*cmap->mranges)); cmap->mcap = counts[2]; walk_splay(cmap->tree, cmap->ttop, copy_node_types, cmap); fz_free(ctx, cmap->tree); cmap->tree = NULL; }
332,720,040,698,217,900,000,000,000,000,000,000,000
pdf-cmap.c
166,954,317,636,236,650,000,000,000,000,000,000,000
[ "CWE-416" ]
CVE-2018-1000039
In MuPDF 1.12.0 and earlier, multiple heap use after free bugs in the PDF parser could allow an attacker to execute arbitrary code, read memory, or cause a denial of service via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000039
11,213
ghostscript
b2e7d38e845c7d4922d05e6e41f3a2dc1bc1b14a
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=b2e7d38e845c7d4922d05e6e41f3a2dc1bc1b14a;hp=f51836b9732c38d945b87fda0770009a77ba680c
None
0
begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save) { pdf_gstate *gstate = pr->gstate + pr->gtop; pdf_xobject *softmask = gstate->softmask; fz_rect mask_bbox; fz_matrix tos_save[2], save_ctm; fz_matrix mask_matrix; fz_colorspace *mask_colorspace; save->softmask = softmask; if (softmask == NULL) return gstate; save->page_resources = gstate->softmask_resources; save->ctm = gstate->softmask_ctm; save_ctm = gstate->ctm; pdf_xobject_bbox(ctx, softmask, &mask_bbox); pdf_xobject_matrix(ctx, softmask, &mask_matrix); pdf_tos_save(ctx, &pr->tos, tos_save); if (gstate->luminosity) mask_bbox = fz_infinite_rect; else { fz_transform_rect(&mask_bbox, &mask_matrix); fz_transform_rect(&mask_bbox, &gstate->softmask_ctm); } gstate->softmask = NULL; gstate->softmask_resources = NULL; gstate->ctm = gstate->softmask_ctm; mask_colorspace = pdf_xobject_colorspace(ctx, softmask); if (gstate->luminosity && !mask_colorspace) mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx)); fz_try(ctx) { fz_begin_mask(ctx, pr->dev, &mask_bbox, gstate->luminosity, mask_colorspace, gstate->softmask_bc, &gstate->fill.color_params); pdf_run_xobject(ctx, pr, softmask, save->page_resources, &fz_identity, 1); } fz_always(ctx) fz_drop_colorspace(ctx, mask_colorspace); fz_catch(ctx) { fz_rethrow_if(ctx, FZ_ERROR_TRYLATER); /* FIXME: Ignore error - nasty, but if we throw from * here the clip stack would be messed up. */ /* TODO: pass cookie here to increase the cookie error count */ } fz_end_mask(ctx, pr->dev); pdf_tos_restore(ctx, &pr->tos, tos_save); gstate = pr->gstate + pr->gtop; gstate->ctm = save_ctm; return gstate; }
104,260,325,680,532,720,000,000,000,000,000,000,000
pdf-op-run.c
315,426,774,193,015,070,000,000,000,000,000,000,000
[ "CWE-20" ]
CVE-2018-1000037
In MuPDF 1.12.0 and earlier, multiple reachable assertions in the PDF parser allow an attacker to cause a denial of service (assert crash) via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000037
11,214
ghostscript
b2e7d38e845c7d4922d05e6e41f3a2dc1bc1b14a
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=b2e7d38e845c7d4922d05e6e41f3a2dc1bc1b14a;hp=f51836b9732c38d945b87fda0770009a77ba680c
None
0
fz_always(ctx) { fz_drop_path(ctx, path); }
286,612,868,306,126,840,000,000,000,000,000,000,000
None
null
[ "CWE-20" ]
CVE-2018-1000037
In MuPDF 1.12.0 and earlier, multiple reachable assertions in the PDF parser allow an attacker to cause a denial of service (assert crash) via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000037
11,215
ghostscript
b2e7d38e845c7d4922d05e6e41f3a2dc1bc1b14a
http://git.ghostscript.com/?p=mupdf
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=b2e7d38e845c7d4922d05e6e41f3a2dc1bc1b14a;hp=f51836b9732c38d945b87fda0770009a77ba680c
None
0
fz_catch(ctx) { fz_rethrow(ctx); }
79,843,115,906,685,780,000,000,000,000,000,000,000
None
null
[ "CWE-20" ]
CVE-2018-1000037
In MuPDF 1.12.0 and earlier, multiple reachable assertions in the PDF parser allow an attacker to cause a denial of service (assert crash) via a crafted file.
https://nvd.nist.gov/vuln/detail/CVE-2018-1000037
11,294
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
check_data_region (struct tar_sparse_file *file, size_t i) { off_t size_left; if (!lseek_or_error (file, file->stat_info->sparse_map[i].offset)) return false; rdsize); return false; }
262,796,672,957,164,630,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,295
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end) { if (!lseek_or_error (file, beg)) return false; while (beg < end) { size_t bytes_read; size_t rdsize = BLOCKSIZE < end - beg ? BLOCKSIZE : end - beg; char diff_buffer[BLOCKSIZE]; bytes_read = safe_read (file->fd, diff_buffer, rdsize); if (bytes_read == SAFE_READ_ERROR) { read_diag_details (file->stat_info->orig_file_name, beg, rdsize); return false; } if (!zero_block_p (diff_buffer, bytes_read)) { char begbuf[INT_BUFSIZE_BOUND (off_t)]; report_difference (file->stat_info, _("File fragment at %s is not a hole"), offtostr (beg, begbuf)); return false; } beg += bytes_read; } return true; }
8,228,776,884,049,815,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,296
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
dump_zeros (struct tar_sparse_file *file, off_t offset) { static char const zero_buf[BLOCKSIZE]; if (offset < file->offset) { errno = EINVAL; return false; } while (file->offset < offset) { size_t size = (BLOCKSIZE < offset - file->offset ? BLOCKSIZE : offset - file->offset); ssize_t wrbytes; wrbytes = write (file->fd, zero_buf, size); if (wrbytes <= 0) { if (wrbytes == 0) errno = EINVAL; return false; } file->offset += wrbytes; } return true; }
327,683,830,022,348,900,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,297
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
lseek_or_error (struct tar_sparse_file *file, off_t offset) { if (file->seekable ? lseek (file->fd, offset, SEEK_SET) < 0 : ! dump_zeros (file, offset)) { seek_diag_details (file->stat_info->orig_file_name, offset); return false; } return true; }
200,300,799,182,966,160,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,298
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_add_map (struct tar_stat_info *st, struct sp_array const *sp) { struct sp_array *sparse_map = st->sparse_map; size_t avail = st->sparse_map_avail; if (avail == st->sparse_map_size) st->sparse_map = sparse_map = x2nrealloc (sparse_map, &st->sparse_map_size, sizeof *sparse_map); sparse_map[avail] = *sp; st->sparse_map_avail = avail + 1; }
133,198,796,031,614,500,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,299
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_extract_file (int fd, struct tar_stat_info *st, off_t *size) { bool rc = true; struct tar_sparse_file file; size_t i; if (!tar_sparse_init (&file)) return dump_status_not_implemented; file.stat_info = st; file.fd = fd; file.seekable = lseek (fd, 0, SEEK_SET) == 0; file.offset = 0; rc = tar_sparse_decode_header (&file); for (i = 0; rc && i < file.stat_info->sparse_map_avail; i++) rc = tar_sparse_extract_region (&file, i); *size = file.stat_info->archive_file_size - file.dumped_size; return (tar_sparse_done (&file) && rc) ? dump_status_ok : dump_status_short; }
141,251,868,747,118,650,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,300
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_scan_file (struct tar_sparse_file *file) { /* always check for completely sparse files */ if (sparse_scan_file_wholesparse (file)) return true; switch (hole_detection) { case HOLE_DETECTION_DEFAULT: case HOLE_DETECTION_SEEK: #ifdef SEEK_HOLE if (sparse_scan_file_seek (file)) return true; #else if (hole_detection == HOLE_DETECTION_SEEK) WARN((0, 0, _("\"seek\" hole detection is not supported, using \"raw\"."))); /* fall back to "raw" for this and all other files */ hole_detection = HOLE_DETECTION_RAW; #endif FALLTHROUGH; case HOLE_DETECTION_RAW: if (sparse_scan_file_raw (file)) return true; } return false; }
74,478,474,468,345,040,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,301
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_scan_file_raw (struct tar_sparse_file *file) { struct tar_stat_info *st = file->stat_info; int fd = file->fd; char buffer[BLOCKSIZE]; size_t count = 0; off_t offset = 0; struct sp_array sp = {0, 0}; st->archive_file_size = 0; if (!tar_sparse_scan (file, scan_begin, NULL)) return false; while ((count = blocking_read (fd, buffer, sizeof buffer)) != 0 && count != SAFE_READ_ERROR) { /* Analyze the block. */ if (zero_block_p (buffer, count)) { if (sp.numbytes) { sparse_add_map (st, &sp); sp.numbytes = 0; if (!tar_sparse_scan (file, scan_block, NULL)) return false; } } else { if (sp.numbytes == 0) sp.offset = offset; sp.numbytes += count; st->archive_file_size += count; if (!tar_sparse_scan (file, scan_block, buffer)) return false; } offset += count; } /* save one more sparse segment of length 0 to indicate that the file ends with a hole */ if (sp.numbytes == 0) sp.offset = offset; sparse_add_map (st, &sp); st->archive_file_size += count; return tar_sparse_scan (file, scan_end, NULL); }
223,710,354,877,674,100,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,302
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_scan_file_seek (struct tar_sparse_file *file) { struct tar_stat_info *st = file->stat_info; int fd = file->fd; struct sp_array sp = {0, 0}; off_t offset = 0; off_t data_offset; off_t hole_offset; st->archive_file_size = 0; for (;;) { /* locate first chunk of data */ data_offset = lseek (fd, offset, SEEK_DATA); if (data_offset == (off_t)-1) /* ENXIO == EOF; error otherwise */ { if (errno == ENXIO) { /* file ends with hole, add one more empty chunk of data */ sp.numbytes = 0; sp.offset = st->stat.st_size; sparse_add_map (st, &sp); return true; } return false; } hole_offset = lseek (fd, data_offset, SEEK_HOLE); /* according to specs, if FS does not fully support SEEK_DATA/SEEK_HOLE it may just implement kind of "wrapper" around classic lseek() call. We must detect it here and try to use other hole-detection methods. */ if (offset == 0 /* first loop */ && data_offset == 0 && hole_offset == st->stat.st_size) { lseek (fd, 0, SEEK_SET); return false; } sp.offset = data_offset; sp.numbytes = hole_offset - data_offset; sparse_add_map (st, &sp); st->archive_file_size += sp.numbytes; offset = hole_offset; } return true; }
183,179,349,104,804,240,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,303
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_scan_file_wholesparse (struct tar_sparse_file *file) { struct tar_stat_info *st = file->stat_info; struct sp_array sp = {0, 0}; /* Note that this function is called only for truly sparse files of size >= 1 block size (checked via ST_IS_SPARSE before). See the thread http://www.mail-archive.com/bug-tar@gnu.org/msg04209.html for more info */ if (ST_NBLOCKS (st->stat) == 0) { st->archive_file_size = 0; sp.offset = st->stat.st_size; sparse_add_map (st, &sp); return true; } return false; }
101,116,579,052,339,830,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,304
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_select_optab (struct tar_sparse_file *file) { switch (current_format == DEFAULT_FORMAT ? archive_format : current_format) { case V7_FORMAT: case USTAR_FORMAT: return false; case OLDGNU_FORMAT: case GNU_FORMAT: /*FIXME: This one should disappear? */ file->optab = &oldgnu_optab; break; case POSIX_FORMAT: file->optab = &pax_optab; break; case STAR_FORMAT: file->optab = &star_optab; break; default: return false; } return true; }
174,896,022,340,243,830,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,305
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
sparse_skip_file (struct tar_stat_info *st) { bool rc = true; struct tar_sparse_file file; if (!tar_sparse_init (&file)) return dump_status_not_implemented; file.stat_info = st; file.fd = -1; rc = tar_sparse_decode_header (&file); skip_file (file.stat_info->archive_file_size - file.dumped_size); return (tar_sparse_done (&file) && rc) ? dump_status_ok : dump_status_short; }
49,509,729,959,645,500,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,306
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
tar_sparse_done (struct tar_sparse_file *file) { if (file->optab->done) return file->optab->done (file); return true; }
9,823,830,495,952,547,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482
11,307
savannah
c15c42ccd1e2377945fd0414eca1a49294bff454
https://git.savannah.gnu.org/gitweb/?p=gnutls
https://git.savannah.gnu.org/cgit/tar.git/commit/?id=c15c42ccd1e2377945fd0414eca1a49294bff454
None
0
tar_sparse_dump_header (struct tar_sparse_file *file) { if (file->optab->dump_header) return file->optab->dump_header (file); return false; }
23,843,709,900,235,880,000,000,000,000,000,000,000
None
null
[ "CWE-835" ]
CVE-2018-20482
GNU Tar through 1.30, when --sparse is used, mishandles file shrinkage during read access, which allows local users to cause a denial of service (infinite read loop in sparse_dump_region in sparse.c) by modifying a file that is supposed to be archived by a different user's process (e.g., a system backup running as root).
https://nvd.nist.gov/vuln/detail/CVE-2018-20482