hitoshura25/cvefixes huggingface dataset:
CVE-2014-3571 (C, published 2015-01-09T02:59Z)
Description: value: OpenSSL before 0.9.8zd, 1.0.0 before 1.0.0p, and 1.0.1 before 1.0.1k allows remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a crafted DTLS message that is processed with a different read operation for the handshake header than for the handshake body, related to the dtls1_get_record function in d1_pkt.c and the ssl3_read_n function in s3_pkt.c.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: NVD-CWE-Other \u2014 Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
Repository: https://github.com/openssl/openssl
Files changed:
ssl/d1_pkt.c
ssl/s3_pkt.c
Commit message: Fix crash in dtls1_get_record whilst in the listen state where you get two
separate reads performed - one for the header and one for the body of the
handshake record.

CVE-2014-3571

Reviewed-by: Matt Caswell <matt@openssl.org>


Vulnerable code:
		if (n <= 0) return(n); /* error or non-blocking io */


Fixed code:
		if (left == 0 && extend)
			return 0;
CVE-2014-3572 (Other, published 2015-01-09T02:59Z)
Description: value: The ssl3_get_key_exchange function in s3_clnt.c in OpenSSL before 0.9.8zd, 1.0.0 before 1.0.0p, and 1.0.1 before 1.0.1k allows remote SSL servers to conduct ECDHE-to-ECDH downgrade attacks and trigger a loss of forward secrecy by omitting the ServerKeyExchange message.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: CWE-310 \u2014 Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed.
Repository: https://github.com/openssl/openssl
Files changed:
CHANGES
ssl/s3_clnt.c
Commit message: ECDH downgrade bug fix.

Fix bug where an OpenSSL client would accept a handshake using an
ephemeral ECDH ciphersuites with the server key exchange message omitted.

Thanks to Karthikeyan Bhargavan for reporting this issue.

CVE-2014-3572
Reviewed-by: Matt Caswell <matt@openssl.org>


Vulnerable code:
		if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)
	alg_k=s->s3->tmp.new_cipher->algorithm_mkey;
	EVP_MD_CTX_init(&md_ctx);

Fixed code:
  *) Abort handshake if server key exchange message is omitted for ephemeral
     ECDH ciphersuites.

     Thanks to Karthikeyan Bhargavan for reporting this issue.
     (CVE-2014-3572)
     [Steve Henson]

	EVP_MD_CTX_init(&md_ctx);

	alg_k=s->s3->tmp.new_cipher->algorithm_mkey;

		/*
		 * Can't skip server key exchange if this is an ephemeral
		 * ciphersuite.
		 */
		if (alg_k & (SSL_kDHE|SSL_kECDHE))
			{
			SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_UNEXPECTED_MESSAGE);
			al = SSL_AD_UNEXPECTED_MESSAGE;
			goto f_err;
			}
		if (alg_k & SSL_kPSK)
CVE-2014-8176 (C, published 2015-06-12T19:59Z)
Description: value: The dtls1_clear_queues function in ssl/d1_lib.c in OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h frees data structures without considering that application data can arrive between a ChangeCipherSpec message and a Finished message, which allows remote DTLS peers to cause a denial of service (memory corruption and application crash) or possibly have unspecified other impact via unexpected application data.
Severity: HIGH (CVSS v3 base score: )
Weakness: CWE-119 \u2014 Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Repository: https://github.com/openssl/openssl
Files changed:
ssl/d1_lib.c
Commit message: Free up s->d1->buffered_app_data.q properly.

PR#3286


Vulnerable code:
		frag = (hm_fragment *)item->data;
		OPENSSL_free(frag->fragment);
		OPENSSL_free(frag);

Fixed code:
		rdata = (DTLS1_RECORD_DATA *) item->data;
		if (rdata->rbuf.buf)
			{
			OPENSSL_free(rdata->rbuf.buf);
			}
		OPENSSL_free(item->data);
CVE-2014-8275 (C, published 2015-01-09T02:59Z)
Description: value: OpenSSL before 0.9.8zd, 1.0.0 before 1.0.0p, and 1.0.1 before 1.0.1k does not enforce certain constraints on certificate data, which allows remote attackers to defeat a fingerprint-based certificate-blacklist protection mechanism by including crafted data within a certificate's unsigned portion, related to crypto/asn1/a_verify.c, crypto/dsa/dsa_asn1.c, crypto/ecdsa/ecs_vrf.c, and crypto/x509/x_all.c.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: CWE-310 \u2014 Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed.
Repository: https://github.com/openssl/openssl
Files changed:
crypto/asn1/a_verify.c
Commit message: use correct function name

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>


Vulnerable code:
		ASN1err(ASN1_F_ASN1_VERIFY, ASN1_R_INVALID_BIT_STRING_BITS_LEFT);

Fixed code:
		ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ASN1_R_INVALID_BIT_STRING_BITS_LEFT);
CVE-2015-0205 (C, published 2015-01-09T02:59Z)
Description: value: The ssl3_get_cert_verify function in s3_srvr.c in OpenSSL 1.0.0 before 1.0.0p and 1.0.1 before 1.0.1k accepts client authentication with a Diffie-Hellman (DH) certificate without requiring a CertificateVerify message, which allows remote attackers to obtain access without knowledge of a private key via crafted TLS Handshake Protocol traffic to a server that recognizes a Certification Authority with DH support.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: CWE-310 \u2014 Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed.
Repository: https://github.com/openssl/openssl
Files changed:
ssl/s3_srvr.c
Commit message: Unauthenticated DH client certificate fix.

Fix to prevent use of DH client certificates without sending
certificate verify message.

If we've used a client certificate to generate the premaster secret
ssl3_get_client_key_exchange returns 2 and ssl3_get_cert_verify is
never called.

We can only skip the certificate verify message in
ssl3_get_cert_verify if the client didn't send a certificate.

Thanks to Karthikeyan Bhargavan for reporting this issue.
CVE-2015-0205
Reviewed-by: Matt Caswell <matt@openssl.org>


Vulnerable code:
		if ((peer != NULL) && (type & EVP_PKT_SIGN))

Fixed code:
		if (peer != NULL)
CVE-2015-0206 (C, published 2015-01-09T02:59Z)
Description: value: Memory leak in the dtls1_buffer_record function in d1_pkt.c in OpenSSL 1.0.0 before 1.0.0p and 1.0.1 before 1.0.1k allows remote attackers to cause a denial of service (memory consumption) by sending many duplicate records for the next epoch, leading to failure of replay detection.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: CWE-119 \u2014 Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Repository: https://github.com/openssl/openssl
Files changed:
ssl/d1_pkt.c
Commit message: A memory leak can occur in dtls1_buffer_record if either of the calls to
ssl3_setup_buffers or pqueue_insert fail. The former will fail if there is a
malloc failure, whilst the latter will fail if attempting to add a duplicate
record to the queue. This should never happen because duplicate records should
be detected and dropped before any attempt to add them to the queue.
Unfortunately records that arrive that are for the next epoch are not being
recorded correctly, and therefore replays are not being detected.
Additionally, these "should not happen" failures that can occur in
dtls1_buffer_record are not being treated as fatal and therefore an attacker
could exploit this by sending repeated replay records for the next epoch,
eventually causing a DoS through memory exhaustion.

Thanks to Chris Mueller for reporting this issue and providing initial
analysis and a patch. Further analysis and the final patch was performed by
Matt Caswell from the OpenSSL development team.

CVE-2015-0206

Reviewed-by: Dr Stephen Henson <steve@openssl.org>


Vulnerable code:
		
		return(0);
		return(0);
            dtls1_buffer_record(s, &(s->d1->processed_rcds), 
                s->s3->rrec.seq_num);
	dtls1_record_bitmap_update(s, &(s->d1->bitmap));/* Mark receipt of record. */
	dtls1_process_buffered_records(s);
			dtls1_buffer_record(s, &(s->d1->unprocessed_rcds), rr->seq_num);
		dtls1_buffer_record(s, &(s->d1->buffered_app_data), rr->seq_num);

Fixed code:

		if (rdata->rbuf.buf != NULL)
			OPENSSL_free(rdata->rbuf.buf);
		return(-1);
		if (rdata->rbuf.buf != NULL)
			OPENSSL_free(rdata->rbuf.buf);
		return(-1);
            if(dtls1_buffer_record(s, &(s->d1->processed_rcds),
                s->s3->rrec.seq_num)<0)
                return -1;
	if(dtls1_process_buffered_records(s)<0)
		return -1;
			if(dtls1_buffer_record(s, &(s->d1->unprocessed_rcds), rr->seq_num)<0)
				return -1;
			dtls1_record_bitmap_update(s, bitmap);/* Mark receipt of record. */
	dtls1_record_bitmap_update(s, bitmap);/* Mark receipt of record. */
		if(dtls1_buffer_record(s, &(s->d1->buffered_app_data), rr->seq_num)<0)
			{
			SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR);
			return -1;
			}
CVE-2015-1788 (C, published 2015-06-12T19:59Z)
Description: value: The BN_GF2m_mod_inv function in crypto/bn/bn_gf2m.c in OpenSSL before 0.9.8s, 1.0.0 before 1.0.0e, 1.0.1 before 1.0.1n, and 1.0.2 before 1.0.2b does not properly handle ECParameters structures in which the curve is over a malformed binary polynomial field, which allows remote attackers to cause a denial of service (infinite loop) via a session that uses an Elliptic Curve algorithm, as demonstrated by an attack against a server that supports client authentication.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: CWE-399 \u2014 Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
Repository: https://github.com/openssl/openssl
Files changed:
crypto/bn/bn_gf2m.c
Commit message: bn/bn_gf2m.c: avoid infinite loop wich malformed ECParamters.

CVE-2015-1788

Reviewed-by: Matt Caswell <matt@openssl.org>


Vulnerable code:
        int i, ubits = BN_num_bits(u), vbits = BN_num_bits(v), /* v is copy
                                                                * of p */
            top = p->top;
            if (ubits <= BN_BITS2 && udp[0] == 1)
                break;

Fixed code:
        int i;
        int ubits = BN_num_bits(u);
        int vbits = BN_num_bits(v); /* v is copy of p */
        int top = p->top;
            if (ubits <= BN_BITS2) {
                if (udp[0] == 0) /* poly was reducible */
                    goto err;
                if (udp[0] == 1)
                    break;
            }
CVE-2015-1790 (C, published 2015-06-12T19:59Z)
Description: value: The PKCS7_dataDecodefunction in crypto/pkcs7/pk7_doit.c in OpenSSL before 0.9.8zg, 1.0.0 before 1.0.0s, 1.0.1 before 1.0.1n, and 1.0.2 before 1.0.2b allows remote attackers to cause a denial of service (NULL pointer dereference and application crash) via a PKCS#7 blob that uses ASN.1 encoding and lacks inner EncryptedContent data.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: NVD-CWE-Other \u2014 Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
Repository: https://github.com/openssl/openssl
Files changed:
crypto/pkcs7/pk7_doit.c
Commit message: PKCS#7: Fix NULL dereference with missing EncryptedContent.

CVE-2015-1790

Reviewed-by: Rich Salz <rsalz@openssl.org>


Vulnerable code:
    if (PKCS7_is_detached(p7) || (in_bio != NULL)) {

Fixed code:
        /*
         * p7->d.sign->contents is a PKCS7 structure consisting of a contentType
         * field and optional content.
         * data_body is NULL if that structure has no (=detached) content
         * or if the contentType is wrong (i.e., not "data").
         */
        /* data_body is NULL if the optional EncryptedContent is missing. */
        /* data_body is NULL if the optional EncryptedContent is missing. */
    /* Detached content must be supplied via in_bio instead. */
    if (data_body == NULL && in_bio == NULL) {
        PKCS7err(PKCS7_F_PKCS7_DATADECODE, PKCS7_R_NO_CONTENT);
        goto err;
    }

    if (in_bio != NULL) {
CVE-2015-1792 (C, published 2015-06-12T19:59Z)
Description: value: The do_free_upto function in crypto/cms/cms_smime.c in OpenSSL before 0.9.8zg, 1.0.0 before 1.0.0s, 1.0.1 before 1.0.1n, and 1.0.2 before 1.0.2b allows remote attackers to cause a denial of service (infinite loop) via vectors that trigger a NULL value of a BIO data structure, as demonstrated by an unrecognized X.660 OID for a hash function.
Severity: MEDIUM (CVSS v3 base score: )
Weakness: CWE-399 \u2014 Resource Management Errors
Weaknesses in this category are related to improper management of system resources.
Repository: https://github.com/openssl/openssl
Files changed:
crypto/cms/cms_smime.c
Commit message: Canonicalise input in CMS_verify.

If content is detached and not binary mode translate the input to
CRLF format. Before this change the input was verified verbatim
which lead to a discrepancy between sign and verify.


Vulnerable code:
static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
	unsigned char buf[4096];
	int r = 0, i;
	BIO *tmpout = NULL;

		tmpout = BIO_new(BIO_s_null());
		tmpout = BIO_new(BIO_s_mem());
		BIO_set_mem_eof_return(tmpout, 0);
		tmpout = out;
		while (f != upto);
	BIO *cmsbio = NULL, *tmpin = NULL;
		
	cmsbio=CMS_dataInit(cms, tmpin);
	if (!cmsbio)
		goto err;
	if (!cms_copy_content(out, cmsbio, flags))
		goto err;
	
	if (dcont && (tmpin == dcont))
		do_free_upto(cmsbio, dcont);
		BIO_free_all(cmsbio);

Fixed code:
static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
	BIO *rbio;
		rbio = BIO_new(BIO_s_null());
		rbio = BIO_new(BIO_s_mem());
		BIO_set_mem_eof_return(rbio, 0);
		rbio = out;
	return rbio;
	}

static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
	{
	unsigned char buf[4096];
	int r = 0, i;
	BIO *tmpout;

	tmpout = cms_get_text_bio(out, flags);
		while (f && f != upto);
	BIO *cmsbio = NULL, *tmpin = NULL, *tmpout = NULL;
	/* If not binary mode and detached generate digests by *writing*
	 * through the BIO. That makes it possible to canonicalise the
	 * input.
	 */
	if (!(flags & SMIME_BINARY) && dcont)
		{
		/* Create output BIO so we can either handle text or to
		 * ensure included content doesn't override detached content.
		 */
		tmpout = cms_get_text_bio(out, flags);
		if(!tmpout)
			{
			CMSerr(CMS_F_CMS_VERIFY,ERR_R_MALLOC_FAILURE);
			goto err;
			}
		cmsbio = CMS_dataInit(cms, tmpout);
		if (!cmsbio)
			goto err;
		/* Don't use SMIME_TEXT for verify: it adds headers and
		 * we want to remove them.
		 */
		SMIME_crlf_copy(dcont, cmsbio, flags & ~SMIME_TEXT);
		if(flags & CMS_TEXT)
			{
			if (!SMIME_text(tmpout, out))
				{
				CMSerr(CMS_F_CMS_VERIFY,CMS_R_SMIME_TEXT_ERROR);
				goto err;
				}
			}
		}
	else
		{
		cmsbio=CMS_dataInit(cms, tmpin);
		if (!cmsbio)
			goto err;
		if (!cms_copy_content(out, cmsbio, flags))
			goto err;
		}
	if (!(flags & SMIME_BINARY) && dcont)
		{
		do_free_upto(cmsbio, tmpout);
		if (tmpin != dcont)
			BIO_free(tmpin);
		}
		{

		if (dcont && (tmpin == dcont))
			do_free_upto(cmsbio, dcont);
		else
			BIO_free_all(cmsbio);
		}

	if (tmpout && out != tmpout)
		BIO_free_all(tmpout);
CVE-2016-2180 (C, published 2016-08-01T02:59Z)
Description: value: The TS_OBJ_print_bio function in crypto/ts/ts_lib.c in the X.509 Public Key Infrastructure Time-Stamp Protocol (TSP) implementation in OpenSSL through 1.0.2h allows remote attackers to cause a denial of service (out-of-bounds read and application crash) via a crafted time-stamp file that is mishandled by the "openssl ts" command.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: CWE-125 \u2014 Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.
Repository: https://github.com/openssl/openssl
Files changed:
crypto/ts/ts_lib.c
Commit message: Fix OOB read in TS_OBJ_print_bio().

TS_OBJ_print_bio() misuses OBJ_txt2obj: it should print the result
as a null terminated buffer. The length value returned is the total
length the complete text reprsentation would need not the amount of
data written.

CVE-2016-2180

Thanks to Shi Lei for reporting this bug.

Reviewed-by: Matt Caswell <matt@openssl.org>


Vulnerable code:
    int len = OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0);
    BIO_write(bio, obj_txt, len);
    BIO_write(bio, "\n", 1);

Fixed code:
    OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0);
    BIO_printf(bio, "%s\n", obj_txt);
CVE-2022-23067 (Other, published 2022-05-18T14:15Z)
Description: value: ToolJet versions v0.5.0 to v1.2.2 are vulnerable to token leakage via Referer header that leads to account takeover . If the user opens the invite link/signup link and then clicks on any external links within the page, it leaks the password set token/signup token in the referer header. Using these tokens the attacker can access the user’s account.
Severity: MEDIUM (CVSS v3 base score: 8.8)
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/ToolJet/ToolJet
Files changed:
frontend/src/App/App.jsx
frontend/src/ConfirmationPage/ConfirmationPage.jsx
frontend/src/ConfirmationPage/index.js
Commit message: Fix token present in referrer header (#2413)



Vulnerable code:
import { Router, Route } from 'react-router-dom';
import { InvitationPage } from '@/InvitationPage';
            <Route path="/invitations/:token" component={InvitationPage} />
class InvitationPage extends React.Component {
      newSignup: queryString.parse(props.location.search).signup,
    const token = this.props.match.params.token;
export { InvitationPage };
export * from './InvitationPage';

Fixed code:
import { Router, Route, Redirect } from 'react-router-dom';
import { ConfirmationPage } from '@/ConfirmationPage';
            <Route
              path="/invitations/:token"
              render={(props) => (
                <Redirect
                  to={{
                    pathname: '/confirm',
                    state: { token: props.match.params.token, search: props.location.search },
                  }}
                />
              )}
            />
            <Route path="/confirm" component={ConfirmationPage} />
class ConfirmationPage extends React.Component {
      newSignup: queryString.parse(props.location.state.search).signup,
    const token = this.props.location.state.token;
export { ConfirmationPage };
export * from './ConfirmationPage';
CVE-2016-15005 (Unknown, published 2022-12-27T22:15Z)
Description: value: CSRF tokens are generated using math/rand, which is not a cryptographically secure random number generator, allowing an attacker to predict values and bypass CSRF protections with relatively few requests.
Severity: nan (CVSS v3 base score: 8.8)
Weakness: CWE-352 \u2014 Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
Repository: https://github.com/dinever/golf
Files changed:
Commit message: Merge pull request #24 from bentranter/use-crypto-rand-for-xsrf

Use crypto/rand for XSRF token generation

Vulnerable code:

Fixed code:
CVE-2021-3957 (PHP, published 2021-11-19T12:15Z)
Description: value: kimai2 is vulnerable to Cross-Site Request Forgery (CSRF)
Severity: MEDIUM (CVSS v3 base score: 4.3)
Weakness: CWE-352 \u2014 Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
Repository: https://github.com/kevinpapst/kimai2
Files changed:
src/Controller/DoctorController.php
templates/doctor/index.html.twig
Commit message: prevent csrf to flush logs (#2930)



Vulnerable code:
     * @Route(path="/flush-log", name="doctor_flush_log", methods={"GET"})
    public function deleteLogfileAction(): Response
                <a class="btn-box-tool confirmation-link" href="{{ path('doctor_flush_log') }}" data-question="confirm.delete"><i class="{{ 'delete'|icon }}"></i></a>

Fixed code:
use Symfony\Component\Security\Csrf\CsrfToken;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
     * @Route(path="/flush-log/{token}", name="doctor_flush_log", methods={"GET"})
    public function deleteLogfileAction(string $token, CsrfTokenManagerInterface $csrfTokenManager): Response
        if (!$csrfTokenManager->isTokenValid(new CsrfToken('doctor.flush_log', $token))) {
            $this->flashError('action.delete.error');

            return $this->redirectToRoute('doctor');
        }

        $csrfTokenManager->refreshToken($token);

                <a class="btn-box-tool confirmation-link" href="{{ path('doctor_flush_log', {'token': csrf_token('doctor.flush_log')}) }}" data-question="confirm.delete"><i class="{{ 'delete'|icon }}"></i></a>