text
stringlengths
79
3.72M
<vulnerable_code><commit_title>[PATCH] Add stack-overflow check for 'ecma_op_function_call_simple'<commit_description>This patch fixes #4901 JerryScript-DCO-1.0-Signed-off-by: Martin Negyokru negyokru@inf.u-szeged.hu<fixed_code> // Copyright JS Foundation and other contributors, http://js.foundation // // Licensed und...
<vulnerable_code>package com.zrlog.service; import com.jfinal.core.JFinal; import com.zrlog.common.vo.AdminTokenVO; import com.zrlog.model.User; import com.zrlog.util.I18nUtil; import com.zrlog.util.ZrLogUtil; public class PluginHelper { public static Map<String, String> genHeaderMapByRequest(HttpServletRequest...
<vulnerable_code>import com.hibegin.common.util.http.handle.HttpJsonArrayHandle; import com.zrlog.common.Constants; import com.zrlog.common.response.UploadFileResponse; import org.apache.log4j.Logger; import javax.servlet.http.HttpServletRequest; String url; try { List<Map> urls = HttpUtil....
<vulnerable_code>import com.zrlog.model.User; import com.zrlog.service.AdminTokenService; import com.zrlog.service.AdminTokenThreadLocal; import com.zrlog.service.PluginHelper; import com.zrlog.util.BlogBuildInfoUtil; import org.apache.http.Header; import org.apache.http.client.methods.CloseableHttpResponse; import org...
<vulnerable_code> goto mismatch_no_msa; if (range > start) { if ((OnigLen )(min_semi_end - start) > reg->anc_dist_max) { start = min_semi_end - reg->anc_dist_max; if (start < end) start = onigenc_get_right_adjust_char_head(reg->enc, str, start); } if...
<vulnerable_code> except sshpubkeys.InvalidKeyException as e: raise PublicKeyParseError(str(e)) try: get_plugin_proxy().will_add_public_key(pubkey) except PluginRejectedPublicKey as e:<commit_title>[PATCH] Block injection attack in ssh public key handling (#673)<commit_description>Also neede...
<vulnerable_code> SSH_KEY_BAD = "ssh-rsa AAAblahblahkey some-comment" SSH_KEY_RSA_1024 = ( "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDhKgSsCJR9UyQa/Gsheb5F56hg23CVnCLpmpyC2JMqVEptG9CL83Oft" "pOPvEb/785Act4En1VFvwMwTj25VurbG3XI984csiNdWPlM1ke4lHK2PQepSYyZVYn+hhXhzSILNDixhBYeDVv4GOfJM1"<commit_title>[PATCH] Block i...
<vulnerable_code> get_public_keys_of_user, PublicKeyParseError, ) from tests.constants import SSH_KEY_1, SSH_KEY_BAD from tests.fixtures import session, users # noqa: F401 assert get_public_keys_of_user(session, user.id) == [] @patch("grouper.public_key.get_plugin_proxy") def test_rejected_key(get_plugi...
<vulnerable_code> ptr->content_type = (char*)gf_malloc(sizeof(char)*string_len); if (!ptr->content_type) return GF_OUT_OF_MEM; memcpy(ptr->content_type, buf+string_start, string_len); } else { ptr->content_encoding = (char*)gf_malloc(sizeof(char)*string_len); if (!ptr->content_encoding) return GF_...
<vulnerable_code>void Curl_detach_connnection(struct Curl_easy *data) { struct connectdata *conn = data->conn; if(conn) Curl_llist_remove(&conn->easyq, &data->conn_queue, NULL); data->conn = NULL; } &data->conn_queue); if(conn->handler->attach) conn->handler->attach(data, conn)...
<vulnerable_code> Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ NULL /* sha256sum */ }; #endif /* USE_GSKIT */<commit_title>[PATCH] openssl: associate/detach the transfer fr...
<vulnerable_code> Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ gtls_sha256sum /* sha256sum */ }; #endif /* USE_GNUTLS */<commit_title>[PATCH] openssl: associate/detach the transfer from ...
<vulnerable_code> Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ mbedtls_sha256sum /* sha256sum */ }; #endif /* USE_MBEDTLS */<commit_title>[PATCH] openssl: associate/detach the t...
<vulnerable_code> Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ NULL /* sha256sum */ }; #endif<commit_title>[PATCH] openssl: associate/detach the transfer from connection<commit...
<vulnerable_code> Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ nss_false_start, /* false_start */ nss_sha256sum /* sha256sum */ }; #endif /* USE_NSS */<commit_title>[PATCH] openssl: associate/detach the transfer from connect...
<vulnerable_code>#endif }; /* * Number of bytes to read from the random number seed file. This must be * a finite value (because some entropy "files" like /dev/urandom have curl_socket_t sockfd = conn->sock[sockindex]; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; ctx_option_t ctx_options = 0; #if...
<vulnerable_code> static CURLcode set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, int *algIds) { char *startCur = ciphers; int algCount = 0; Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, ...
<vulnerable_code> Curl_none_engines_list, /* engines_list */ sectransp_false_start, /* false_start */ sectransp_sha256sum /* sha256sum */ }; #ifdef __clang__<commit_title>[PATCH] openssl: associate/detach the transfer from connection<commit_description>CVE-2021-22901 Bug:...
<vulnerable_code> return CURLE_OK; } void Curl_ssl_close_all(struct Curl_easy *data) { Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ NULL /* sha256sum */ }; ...
<vulnerable_code> Curl_none_set_engine_default, /* set_engine_default */ Curl_none_engines_list, /* engines_list */ Curl_none_false_start, /* false_start */ wolfssl_sha256sum /* sha256sum */ }; #endif<commit_title>[PATCH] openssl: associate/detach the transfer from connectio...
<vulnerable_code> return bus->close_on_exit; }<commit_title>[PATCH] sd-bus: introduce API for re-enqueuing incoming messages<commit_description>When authorizing via PolicyKit we want to process incoming method calls twice: once to process and figure out that we need PK authentication, and a second time after we...
<vulnerable_code> if (pl.len) { lc -= pl.len; getCode (pl.lit, rlc, c, lc, in, out, outb, oe); } else<commit_title>[PATCH] check for valid Huf code lengths<commit_description>Signed-off-by: Peter Hillman <peterh@wetafx.co.nz><fixed_code> if (pl.len) { lc -= pl.len; if ( lc < 0 ) ...
<vulnerable_code>#include "container.h" #include "../config.h" int hyper_setup_env(struct env *envs, int num, bool setPATH) { int i, ret = 0; // the same as getpwnam(), but it only parses /etc/passwd and allows name to be id string struct passwd *hyper_getpwnam(const char *name) { uid_t uid = (uid_t)id_or_max(name);...
<vulnerable_code> } return 0; }<commit_title>[PATCH] Made some changes to the I/O stream library for memory<commit_description><fixed_code> } return 0; } /******************************************************************************\ * Code. \************************************************************************...
<vulnerable_code> !jas_safe_size_mul(size, cmpt->cps_, &size)) { goto error; } cmpt->stream_ = (inmem) ? jas_stream_memopen(0, size) : jas_stream_tmpfile(); if (!cmpt->stream_) { goto error;<commit_title>[PATCH] Made some changes to the I/O stream library for memory<commit_description><fixed_code> !jas_s...
<vulnerable_code> return stream; } jas_stream_t *jas_stream_memopen(char *buf, int bufsize) { jas_stream_t *stream; return stream; } jas_stream_t *jas_stream_fopen(const char *filename, const char *mode) { jas_stream_t *stream; int c; char *bufptr; bufptr = buf; n = 0; int n; const char *bufptr; bufptr =...
<vulnerable_code><commit_title>[PATCH] copy<commit_description>Signed-off-by: Yuri Shkuro <ysh@meta.com><fixed_code> // Forked from https://github.com/mafintosh/json-markup/blob/master/index.js // // The MIT License (MIT) // // Copyright (c) 2023 The Jaeger Authors // Copyright (c) 2014 Mathias Buus // // Permission is...
<vulnerable_code> tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); tcp_hdrlen = tcph->doff * 4; if (len < tcp_hdrlen) return -1; if (info->mss == XT_TCPMSS_CLAMP_PMTU) { if (len > tcp_hdrlen) return 0; /* * MSS Option not found ?! add it.. */<commit_title>[PATCH] netfilter: xt_TCPMSS: add mo...
<vulnerable_code> /* Set PCL render geometry. */ width=(size_t) floor(bounds.x2-bounds.x1+0.5); height=(size_t) floor(bounds.y2-bounds.y1+0.5); if (width > page.width) page.width=width; if (height > page.height)<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/pull/4986...
<vulnerable_code> break; p++; } if (*p != IAC) goto pktend; <commit_title>[PATCH] CVE-2017-12988/TELNET: Add a missing bounds check.<commit_description><fixed_code> break; p++; } ND_TCHECK(*p); if (*p != IAC) goto pktend;
<vulnerable_code>#include "file.h" #ifndef lint FILE_RCSID("@(#)$File: cdf.c,v 1.58 2014/05/13 16:41:06 christos Exp $") #endif #include <assert.h> i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); if (inp[i].pi_type & CDF_VECTOR) { nelements = CDF_GETUINT32(q, 1); o = 2; } else { nelements = 1; }...
<vulnerable_code> atomic_dec(&netbk->netfront_count); } static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx); static void make_tx_response(struct xenvif *vif, struct xen_netif_tx_request *txp, s8 st); { struct gnttab_copy *gop = *gopp; u16 pending_idx = *((u16 *)skb->data...
<vulnerable_code>{ int v, i; if (s->color_type == PNG_COLOR_TYPE_PALETTE) { if (length > 256 || !(s->state & PNG_PLTE)) return AVERROR_INVALIDDATA; } } else if (s->color_type == PNG_COLOR_TYPE_GRAY || s->color_type == PNG_COLOR_TYPE_RGB) { if ((s->color_type == PNG_COLOR...
<vulnerable_code> // [databind#1737]; 3rd party //s.add("org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor"); // deprecated by [databind#1855] s.add("org.springframework.beans.factory.config.PropertyPathFactoryBean"); // s.add("com.mchange.v2.c3p0.JndiRefForwardingDataSource"); // depre...
<vulnerable_code> PlayerGeneric::~PlayerGeneric() { if (mixer) delete mixer; if (player) { if (mixer->isActive() && !mixer->isDeviceRemoved(player)) mixer->removeDevice(player); delete player; } delete[] audioDriverName; <commit_title>[PATCH] Fix use-after-free in PlayerGeneric destructor<commit_descr...
<vulnerable_code> } if (id) { id = id.replace(/\.\./g, ''); // do not allow to write in parent directories } if (name.indexOf('..') !== -1) { name = path.normalize(name); name = name.replace(/\\/g, '/'); } if (name[0] === '/') name = name.substring(1); // do not allow ab...
<vulnerable_code> }); }); it(textName + 'should unlink file', done => { const objects = context.objects; objects.unlink(testId, 'myFile/abc1.txt', err => {<commit_title>[PATCH] some security enhancements to better prevent path traversing<commit_description><fixed_code> }); })...
<vulnerable_code> # [START howto_operator_bash_template] also_run_this = BashOperator( task_id='also_run_this', bash_command='echo "run_id={{ run_id }} | dag_run={{ dag_run }}"', ) # [END howto_operator_bash_template] also_run_this >> run_this_last<commit_title>[PATCH] Change the temp...
<vulnerable_code> &required_size, nullptr); //alloc data dev_detail_data = (SP_DEVICE_INTERFACE_DETAIL_DATA_A*) malloc(required_size); dev_detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETA...
<vulnerable_code>{ int i; u_entry_T *uep; char_u **array; char_u *line; int line_len; uep->ue_size = undo_read_4c(bi); if (uep->ue_size > 0) { array = (char_u **)U_ALLOC_LINE(sizeof(char_u *) * uep->ue_size); if (array == NULL) { *error = TRUE; } vim_memset(array, 0, sizeof(...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 377, /**/<commit_title>[PATCH] patch 8.0.0378: possible overflow when reading corrupted undo<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ ...
<vulnerable_code> return -1; } /* make a buffer to hold the data and snag it from the input stream */ str=(unsigned char *) AcquireQuantumMemory((size_t) count,sizeof(*str)); if (str == (unsigned char *) NULL) { PString=(unsigned char *) RelinquishMagickMemory(PString);<commit_tit...
<vulnerable_code> } def run_as_real_user(args: list[str]) -> None: """Call subprocess.run as real user if called via sudo/pkexec. If we are called through pkexec/sudo, determine the real user ID and run the command with it to get the user's web browser settings. """ uid = _get_env_int("SUDO_UI...
<vulnerable_code> with unittest.mock.patch( "subprocess.run", side_effect=mock_run_calls_except_pgrep ) as run_mock: run_as_real_user(["/bin/true"]) run_mock.assert_called_with( ["/bin/true"], with unittest.mock.patch( ...
<vulnerable_code> return !AccessController.class.getName().equals(stackFrame.getClassName()); } private boolean isCallNotWhitelisted(String call) { return SecurityConstants.STACK_BLACKLIST.stream().anyMatch(call::startsWith) || (SecurityConstants.STACK_WHITELIST.stream().noneMatch(call::startsWith) && (...
<vulnerable_code> static final Set<String> STACK_WHITELIST = Set.of("java.", "org.junit.", "jdk.", "org.eclipse.", "com.intellij", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ "org.assertj", "org.opentest4j.", "com.sun.", "sun.", "org.apache.", "de.tum.in.test.", "net.jqwik", //$NON-NLS-1$ /...
<vulnerable_code> private final String testExecuteGit = "testExecuteGit"; private final String testMaliciousExceptionA = "testMaliciousExceptionA"; private final String testMaliciousExceptionB = "testMaliciousExceptionB"; private final String testNewClassLoader = "testNewClassLoader"; private final String testNewSe...
<vulnerable_code> assertFalse(SecurityPenguin.maliciousExceptionB()); } @Test void testNewClassLoader() throws IOException { SecurityPenguin.newClassLoader();<commit_title>[PATCH] Merge pull request from GHSA-883x-6fch-6wjx<commit_description>* Blacklist ReflectionUtils.getUnderlyingCause as it is in the invocat...
<vulnerable_code>import org.apache.xyz.Circumvention; import org.apache.xyz.FakeTrustedClass; import org.apache.xyz.MaliciousExceptionB; import de.tum.in.test.api.io.IOTester; return ab.get(); } @SuppressWarnings("resource") public static void newClassLoader() throws IOException { new URLClassLoader(new URL[0...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-883x-6fch-6wjx<commit_description>* Blacklist ReflectionUtils.getUnderlyingCause as it is in the invocation This means that trusted classes are no longer have a fully whitelisted stack when the cause is fetched and exception methods are invoked. * Al...
<vulnerable_code> if (startingNode == DomNode.this) { return null; } final DomNode parent = startingNode.getParentNode(); if (parent == null || parent == DomNode.this) { return null; } DomNode next = parent.getNextSib...
<vulnerable_code> i = 0; while (i < length) { tlv = cp + i; type = EXTRACT_16BITS(tlv); optlen = EXTRACT_16BITS(tlv + 2); ND_PRINT((ndo, "%s", tok2str(dh6opt_str, "Unknown", type))); ND_PRINT((ndo," (%u)", optlen + 4 )); switch (type) { case DH6OPT_D...
<vulnerable_code> BYTE *src; ULONG magic; src = p->data; in = 0; <commit_title>[PATCH] fix another invalid read<commit_description><fixed_code> BYTE *src; ULONG magic; if (p->size < 4) return 0; src = p->data; in = 0;
<vulnerable_code> db.Rule.get_by_('collaboration', Scope.ORGANIZATION, Operation.VIEW), db.Rule.get_by_('role', Scope.ORGANIZATION, Operation.VIEW), db.Rule.get_by_('node', Scope.ORGANIZATION, Operation.VIEW), db.Rule.get_by_('task', Scope.ORGANIZATION, Operation.VIEW), db.Rule.ge...
<vulnerable_code> */ package org.xwiki.flamingo; import org.jsoup.nodes.Document; import org.junit.jupiter.api.Test; import org.xwiki.localization.macro.internal.TranslationMacro; import org.xwiki.model.reference.DocumentReference; import org.xwiki.rendering.RenderingScriptServiceComponentList; import org.xwiki.render...
<vulnerable_code> }); }); }); <commit_title>[PATCH] Add tests.<commit_description><fixed_code> }); }); describe('establishing a session without session support', function() { var passport = new Passport(); passport.serializeUser(function(user, done) { done(nul...
<vulnerable_code> BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Called IOCTL_BCM_GET_DEVICE_DRIVER_INFO\n"); DevInfo.MaxRDMBufferSize = BUFFER_4K; DevInfo.u32DSDStartOffset = EEPROM_CALPARAM_START; DevInfo.u32RxAlignmentCorrection = 0;<commit_title>[PATCH] Staging: bcm: info leak in ioctl<c...
<vulnerable_code> package org.opennms.web.utils; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.PageContext; import java.util.Arrays; impor...
<vulnerable_code> if (image->type != GrayscaleType) (void) TransformImageColorspace(image,GRAYColorspace,exception); if (image->storage_class == PseudoClass) colormap_index=(ssize_t *) AcquireQuantumMemory(image->colors+1, sizeof(*colormap_index)); else colormap_index=(ssize_t *) AcquireQuantumMe...
<vulnerable_code> break; case 12: /* FLI LC chunk (byte delta) */ y = I16(data); ymax = y + I16(data+2); data += 4; for (; y < ymax && y < state->ysize; y++) { UINT8* out = (UINT8*) im->image[y]; int p, packets = *data++; for (p = x = 0; p < packets; p++, x += i) { x += data[0]; /* skip ...
<vulnerable_code> tag->frameList("TDAT").size() == 1) { TextIdentificationFrame *tdrc = static_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front()); UnknownFrame *tdat = static_cast<UnknownFrame *>(tag->frameList("TDAT").front()); if(tdrc->fieldList().size() == 1 && tdrc->fiel...
<vulnerable_code> if (length != 0) { chunk=(unsigned char *) AcquireQuantumMemory(length+MagickPathExtent, sizeof(*chunk)); if (length != 0) { chunk=(unsigned char *) AcquireQuantumMemory(length+ MagickPathExtent,sizeof(*chunk)); <commit_title>[P...
<vulnerable_code> return (major > 1) && (major < 8); } static inline int kvx_is_nop_opcode(ut32 x) { return ((x)<<1) == 0xFFFFFFFE; } static inline int kvx_opc_match(const opc_t *opc, insn_t *insn) { int i;<commit_title>[PATCH] aaef on arm/thumb switches causes uaf ##crash<commit_description>* Reported by peacock-d...
<vulnerable_code>/* radare - LGPL - Copyright 2009-2021 - pancake, nibble */ #include <r_types.h> #include <r_list.h> typedef struct { RAnalOp *op; RAnalFunction *fcn; const char *spname; ut64 initial_sp; } EsilBreakCtx; bool gp_fixed = r_config_get_i (core->config, "anal.gpfixed"); RAnalEsil *ESIL = core->anal...
<vulnerable_code>import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.mockito.Mock; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; import javax.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStre...
<vulnerable_code> case M_SOF13: case M_SOF14: case M_SOF15: exif_process_SOFn(Data, marker, &sof_info); ImageInfo->Width = sof_info.width; ImageInfo->Height = sof_info.height;<commit_title>[PATCH] exif_scan_JPEG_header: Added length check to prevent<commit_description><fixed_co...
<vulnerable_code> CaptureType type = em.find( CaptureType.class, url_suffix ); if( type != null ) { return type.getCaptureFilter(); } return null; } public CaptureType find( String url_suffix )<commit_title>[PATCH] Fixed major se...
<vulnerable_code> if (!err && (iattr->ia_valid & ATTR_UID)) { struct socket *sock = SOCKET_I(d_inode(dentry)); sock->sk->sk_uid = iattr->ia_uid; } return err; * an inode not a file. */ void sock_release(struct socket *sock) { if (sock->ops) { struct module *owner = sock->ops->owner; sock->ops->release(...
<vulnerable_code> values.put(MySQLiteHelper.TAGS_COLUMN_TAG, tag.getValue()); // If existing, do nothing : Cursor cursor = db.query(MySQLiteHelper.TABLE_TAGS, allColumns, MySQLiteHelper.TAGS_COLUMN_ID_ACCOUNT + " = " + tag.getMasterAccountId() + " AND " + ...
<vulnerable_code> dependent_objects.append(format_html('<a href="{}">{}</a>', dependent.get_absolute_url(), dependent)) else: dependent_objects.append(escape(str(dependent))) err_message += mark_safe(", ".join(dependent_objects)) messages.error(request, err_message)<commit_title>...
<vulnerable_code> } case PB_HTYPE_ONEOF: *(pb_size_t*)iter->pSize = iter->pos->tag; if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE) { /* We memset to zero so that any callbacks are set to NULL. * Then set any default values. */ ...
<vulnerable_code> const keys = Object.keys(obj); const typeKey = this.options.typeKey; for (const key of keys) { const fullPath = prefix + key; const val = obj[key]; let fullPath = ''; for (const sub of subpaths) { fullPath = fullPath += (fullPath.length > 0 ? '.' : '') + sub; if (!branch[sub...
<vulnerable_code> }); }, /Cannot use schema-level projections.*subdocument_mapping.not_selected/); }); });<commit_title>[PATCH] fix(schema): disallow setting __proto__ when creating schema<commit_description><fixed_code> }); }, /Cannot use schema-level projections.*subdocument_mapping.not_selected/...
<vulnerable_code> channel; char key[MaxTextExtent], *value; const char *attribute, *keyword; double attribute=InterpretImageProperties(msl_info->image_info[n], msl_info->attributes[n],(const char *) attributes[i]); CloneString(&value,attribute); ...
<vulnerable_code> dst_len = ieee802154_get_dst(mhr, dst, &_pan_tmp); src_len = ieee802154_get_src(mhr, src, &_pan_tmp); if ((dst_len < 0) || (src_len < 0)) { DEBUG("_make_netif_hdr: unable to get addresses\n"); return NULL; }<commit_title>[PATCH] gnrc_netif_ieee802154: Ignore packets wit...
<vulnerable_code>import rdiffweb.test class CsrfTest(rdiffweb.test.WebCase): login = True def test_samesite_lax(self): # Given a request made to rdiffweb # When receiving the response self.getPage('/') cookie = self.assertHeader('Set-Cookie') self.assertIn('SameSite=L...
<vulnerable_code>import rdiffweb.tools.i18n import rdiffweb.tools.proxy import rdiffweb.tools.ratelimit import rdiffweb.tools.security from rdiffweb.controller import Controller from rdiffweb.controller.api import ApiPage from rdiffweb.controller.dispatch import static # noqa @cherrypy.tools.proxy() class Root(Locat...
<vulnerable_code> http.cookies.Morsel._reserved['samesite'] = 'SameSite' class CsrfAuth(HandlerTool): """ This tool provide CSRF mitigation. * Define X-Frame-Options = DENY * Define Cookies SameSite=Lax * Validate `Origin` and `Referer` on POST, PUT, PATCH, DELETE Ref.: """ def _...
<vulnerable_code>static int update_header(void *obj) { struct header_data *data = obj; pjsip_hdr *hdr = NULL; RAII_VAR(struct ast_datastore *, datastore, ast_sip_session_get_datastore(data->channel->session, data->header_datastore->type), return -1; } pj_strcpy2(&((pjsip_generic_string_hdr *) hdr)->hvalue, ...
<vulnerable_code> var result = null; if (dataUrlParts.length === 2) { var extractedInfo = /^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec( dataUrlParts[0] ); if (Array.isArray(extractedInfo)) {<commit_title>[PATCH] fix ReDoS-vulnerable regexp in addImage (#3091)<commit_description><fixe...
<vulnerable_code> GPR_ASSERT(*err); uint8_t slots = (uint8_t)(size / sizeof(intptr_t)); if ((*err)->arena_size + slots > (*err)->arena_capacity) { (*err)->arena_capacity = (uint8_t)(3 * (*err)->arena_capacity / 2); *err = gpr_realloc( *err, sizeof(grpc_error) + (*err)->arena_capacity * sizeof(intpt...
<vulnerable_code> grpc_error* parent = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING("Parent", children, 2); gpr_log(GPR_DEBUG, "%s", grpc_error_string(parent)); for (size_t i = 0; i < 2; ++i) { GRPC_ERROR_UNREF(children[i]); } GRPC_ERROR_UNREF(error); } int main(int argc, char** argv) { grpc...
<vulnerable_code> *pred_rtrn = MATCH_EXACTLY; if (expr->expr.op == EXPR_ACTION_DECL) { const char *pred_txt = xkb_atom_text(info->ctx, expr->action.name); if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn)) { log_err(info->ctx, "Illegal modifier pre...
<vulnerable_code>void jsP_dumpsyntax(js_State *J, js_Ast *prog, int dominify) { minify = dominify; if (prog->type == AST_LIST) pstmlist(-1, prog); else { pstm(0, prog); nl(); } if (minify > 1) putchar('\n'); void jsP_dumplist(js_State *J, js_Ast *prog) { minify = 0; if (prog->type == AST_LIST) sblock(0...
<vulnerable_code> if (s <= size) { if (len < s) len = s; i->copy(buf.pData_ + i->tag()*2, byteOrder); } } // Round the size to make it even.<commit_title>[PATCH] Print message to stderr when EXIV2_DEBUG_MESSAGES is enabled.<commit_description><fixed...
<vulnerable_code> if (cmdmod_error(FALSE)) return; if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) eap->errmsg = _(e_finally_without_try); else { if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY)) { eap->errmsg = get_end_emsg(cstack); for (idx = cstack->cs_idx - 1; idx > 0; --idx) if...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 576, /**/<commit_title>[PATCH] patch 9.0.0577: buffer underflow with unexpected :finally<commit_description>Problem: Buffer underflow with unexpected :finally. Solution: Check CSF_TRY can be found.<fixed_code>...
<vulnerable_code> if (pflow != NULL) { /* update inspected tracker for raw reassembly */ if (p->proto == IPPROTO_TCP && pflow->protoctx != NULL) { StreamReassembleRawUpdateProgress(pflow->protoctx, p, det_ctx->raw_stream_progress); <commit_title>[PATCH] stream: fix fa...
<vulnerable_code> magick_info=GetMagickInfo(write_info->magick,exception); if ((magick_info == (const MagickInfo *) NULL) || (GetMagickMimeType(magick_info) == (const char *) NULL)) ThrowWriterException(CorruptImageError,"ImageTypeNotSupported"); (void) CopyMagickString(image->filename,write_info->filena...
<vulnerable_code> self.set_status(404) return filename = "/".join(parts[1:]) abspath = os.path.join(component_root, filename) LOGGER.debug("ComponentRequestHandler: GET: %s -> %s", path, abspath) <commit_title>[PATCH] Ignore component requests outside of the component ro...
<vulnerable_code> self.assertEqual(200, response.code) self.assertEqual(b"Test Content", response.body) def test_invalid_component_request(self): """Test request failure when invalid component name is provided.""" <commit_title>[PATCH] Ignore component requests outside of the component root<...
<vulnerable_code> if (sp->read_error) { return 0; } return (1); no_eoi: TIFFErrorExtR(tif, module, "LZWDecode: Strip %" PRIu32 " not terminated with EOI code", tif->tif_curstrip);<commit_title>[PATCH] LZWDecode(): avoid crash when trying to read again fr...
<vulnerable_code> assignSymbols(target, obj); for (var key in obj) { if (hasOwn(obj, key)) { var val = obj[key]; if (isObject(val)) { if (typeOf(target[key]) === 'undefined' && typeOf(val) === 'function') {<commit_title>[PATCH] exclude __proto__<commit_description><fixed_code> assignSymbol...
<vulnerable_code> } } function templateAddFileBubble(element_id, iframe, filename, tmp_name, batch) { if (batch == 'no') { if (iframe == true) { $('#filenames_' + element_id, window.parent.document).html('<div id ="' + tmp_name + '_container" class ="template_file_box_container"><span class="tagFirstHalf templat...
<vulnerable_code> } parser->m_dataBufEnd = parser->m_dataBuf + INIT_DATA_BUF_SIZE; if (dtd) parser->m_dtd = dtd; else { parser->m_dtd = dtdCreate(&parser->m_mem); if (parser->m_dtd == NULL) { FREE(parser, parser->m_dataBuf); FREE(parser, parser->m_atts); parser->m_parentParser = NULL; ...
<vulnerable_code> return Promise.all(files.map(x => { const dest = path.join(output, x.path); const mode = x.mode & ~process.umask(); const now = new Date(); <commit_title>[PATCH] Throw rather than allowing directory traversal<commit_description><fixed_code> return Promise.all(files.map(x => { const dest = p...
<vulnerable_code> const files = await m(path.join(__dirname, 'fixtures', 'file.tar'), {plugins: []}); t.is(files.length, 0); });<commit_title>[PATCH] Throw rather than allowing directory traversal<commit_description><fixed_code> const files = await m(path.join(__dirname, 'fixtures', 'file.tar'), {plugins: []}); t.is...
<vulnerable_code>static int fscrypt_d_revalidate(struct dentry *dentry, unsigned int flags) { struct dentry *dir; struct fscrypt_info *ci; int dir_has_key, cached_with_key; if (flags & LOOKUP_RCU) return 0; } ci = d_inode(dir)->i_crypt_info; if (ci && ci->ci_keyring_key && (ci->ci_keyring_key->flags & (...
<vulnerable_code> fname->disk_name.len = iname->len; return 0; } ret = fscrypt_get_crypt_info(dir); if (ret && ret != -EOPNOTSUPP) return ret; <commit_title>[PATCH] fscrypt: remove broken support for detecting keyring key<commit_description><fixed_code> fname->disk_name.len = iname->len; return 0; } ret =...
<vulnerable_code> kfree(description); if (IS_ERR(keyring_key)) return PTR_ERR(keyring_key); if (keyring_key->type != &key_type_logon) { printk_once(KERN_WARNING res = -ENOKEY; goto out; } down_read(&keyring_key->sem); ukp = user_key_payload(keyring_key); if (ukp->datalen != sizeof(struct fscrypt_key)) { ...