text
stringlengths
79
3.72M
<vulnerable_code> t.equal(parsed.signature, 'digitalSignature'); t.ok(parsed.signingString); t.equal(parsed.signingString, (options.headers.Date + '\n' + options.headers['content-md5'] + '\n' + 'GET / HTTP/1.1')); t.equal(parsed.params.ke...
<vulnerable_code> options.headers.Date = _rfc1123(); var hmac = crypto.createHmac('sha1', hmacKey); hmac.update(options.headers.Date); options.headers.Authorization = 'Signature keyId="foo",algorithm="hmac-sha1" ' + hmac.digest('base64'); options.headers.Date = _rfc1123(); var signer = crypto.creat...
<vulnerable_code># This has to happen early so things get initialized properly from AccessControl.Implementation import setImplementation from AccessControl.safe_formatter import safe_format from AccessControl.SecurityInfo import ACCESS_NONE from AccessControl.SecurityInfo import ACCESS_PRIVATE from AccessControl.Secur...
<vulnerable_code> kwargs = _MagicFormatMapping(args, kwargs) return self.vformat(self.value, args, kwargs) def safe_format(inst, method): """Use our SafeFormatter that uses guarded_getattr for attribute access.""" return SafeFormatter(inst).safe_format<commit_title>[PATCH] Merge pull request fr...
<vulnerable_code> self.assertRaises(Unauthorized, SafeFormatter('{0[1]}').safe_format, folder)<commit_title>[PATCH] Merge pull request from GHSA-8xv7-89vj-q48c<commit_description>* fix information disclosure via `format_map` * Fix CHANGES.rst according to revi...
<vulnerable_code> struct ext4_map_blocks *map, struct ext4_ext_path *path) { struct ext4_extent *ex, newex, orig_ex; struct ext4_extent *ex1 = NULL; struct ext4_extent *ex2 = NULL; struct ext4_extent *ex3 = NULL; struct ext4_extent_header *eh; ext4_lblk_t ee_block, eof_block; unsigned int allocate...
<vulnerable_code>#include "file.h" #ifndef lint FILE_RCSID("@(#)$File: readelf.c,v 1.137 2017/08/13 00:21:47 christos Exp $") #endif #ifdef BUILTIN_ELF size_t noff, size_t doff, int *flags) { if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 2...
<vulnerable_code> return err; } void xenvif_disconnect(struct xenvif *vif) { struct net_device *dev = vif->dev; if (netif_carrier_ok(dev)) { rtnl_lock(); netif_carrier_off(dev); /* discard queued packets */ if (netif_running(dev)) xenvif_down(vif); rtnl_unlock(); xenvif_put(vif); } atomic_dec(&vif->r...
<vulnerable_code> xenvif_put(vif); } static int netbk_count_requests(struct xenvif *vif, struct xen_netif_tx_request *first, struct xen_netif_tx_request *txp, do { if (frags >= work_to_do) { netdev_dbg(vif->dev, "Need more frags\n"); return -frags; } if (unlikely(frags >= MAX_SKB_FRAGS)) { ne...
<vulnerable_code><commit_title>[PATCH] Add the new implementation of the silence module.<commit_description>This module has significant improvements on the previous one: * Flags which actually make sense. * Better compatibility with other SILENCE implementations. * Support for blocking CTCPs. * Support for blocking...
<vulnerable_code> const domainRestriction = await SystemSettings.get({ label: "account_creation_domain_scope", }); if ( !!domainRestriction && domainRestriction.value !== null && !email.includes(domainRestriction.value) ) { response.status(200).json({ ...
<vulnerable_code> .replace(/(\$|\;|\&|\|)/g, "\\$1") .replace(/(\(|\)|\<|\>)/g, "\\$1") .replace(/("|'|`)/g, "\\$1") .replace(/\{(?=(.*?(?:\,|\.).*?)\})/g, "\\{") .replace(/(?<=\=(?:[^]*?:)?)(~)(?=\:|\=|\-|\+|\/|0|\s|$)/gm, "\\$1"); } else if (quoted) { result = result.replace(/'/g, `...
<vulnerable_code> return; } packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize); reg_w(sd, R51x_FIFO_PSIZE, packet_size >> 5); return; } packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize); ov518_reg_w32(sd, R51x_FIFO_PSIZE, packet_size & ~7, 2); <commit_title>[PATCH] media: ov519: a...
<vulnerable_code> String exportUrl = System.getenv(supportedServices[serviceId]); if (exportUrl == null || exportUrl.isEmpty()) { throw new Exception(supportedServices[serviceId] + " not set"); } URL url = new URL(exportUrl + proxyPath + queryString);<commit_title>[PATCH] 18.1.2 release<co...
<vulnerable_code>"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=...
<vulnerable_code> { ui.setStatusText(ui.editor.getStatus()); if (urlParams['embed'] != '1') { ui.statusContainer.style.display = 'inline-block'; statusVisible = true;<commit_title>[PATCH] 18.1.2 release<commit_description><fixed_code> { ui.setStatusText(ui.editor.getStatus()); if (u...
<vulnerable_code>"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=...
<vulnerable_code>"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=...
<vulnerable_code>var mxClient={VERSION:"18.1.1",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("tex...
<vulnerable_code>if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let i=Promise.resolve();return r[e]||(i=new Promise((async i=>{if("document"in self){const r=document.createElement("script");r.src=e,document.head.appendChild(r),r.onload=i}else importScripts(e),i()}))),i.then((()=>{if(!r[e])throw new Error(`Modul...
<vulnerable_code> log.info(f" Removing run id={run.id}") run.delete() # delete child tasks Task._delete_child_tasks(task) # permissions ok, delete... task.delete() "successfully deleted"}, HTTPStatus.OK @staticmethod def _delete_ch...
<vulnerable_code> int cnt; /* sanity checking for parameters. */ if (g->sect <= 0 || g->head <= 0 || /* check for zero in F_SECT_PER_TRACK */ (unsigned char)((g->sect << 2) >> FD_SIZECODE(g)) == 0 || g->track <= 0 || g->track > UDP->tracks >> STRETCH(g) ||<commit_title>[PATCH] floppy: fix out-of-...
<vulnerable_code> } } strong(src, maskedSrc, prevChar = '') { let match = this.rules.inline.strong.start.exec(src); if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) { maskedSrc = maskedSrc.slice(-1 * src.length); const endReg = mat...
<vulnerable_code> } }; _proto.strong = function strong(src, maskedSrc, prevChar) { if (prevChar === void 0) { prevChar = ''; } var match = this.rules.inline.strong.start.exec(src); if (match && (!match[1] || match[1] && (prevChar === '' || this.rules.inline.punctuation.ex...
<vulnerable_code> * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t...
<vulnerable_code> maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); } while (src) { if (!keepPrevChar) { prevChar = ''; } keepPrevChar = false; // escape ...
<vulnerable_code> } } strong(src, maskedSrc, prevChar = '') { let match = this.rules.inline.strong.start.exec(src); if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) { maskedSrc = maskedSrc.slice(-1 * src.length); const endReg = mat...
<vulnerable_code> reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, reflinkSearch: 'reflink|nolink(?!\\()', strong: { start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/, // (1) returns if starts w/ punctuation mi...
<vulnerable_code><commit_title>[PATCH] fix: Total rework of Emphasis/Strong (#1864)<commit_description>BREAKING CHANGE: `em` and `strong` tokenizers have been merged into one `emStrong` tokenizer<fixed_code> module.exports = { markdown: `${'_'.repeat(101)} a`, html: `<p>${'_'.repeat(101)} a</p>` };
<vulnerable_code> } vps->num_output_layer_sets = num_add_olss + NumLayerSets; layer_set_idx_for_ols_minus1[0] = 1; vps->output_layer_flag[0][0] = 1;<commit_title>[PATCH] fixed #1780 (fuzz)<commit_description><fixed_code> } vps->num_output_layer_sets = num_add_olss + NumLayerSets; if (vps->num_output_layer_sets...
<vulnerable_code> w_align = 4; h_align = 4; } break; case AV_PIX_FMT_PAL8: case AV_PIX_FMT_BGR8: w_align = 4; h_align = 4; } if (s->codec_id == AV_CODEC_ID_JV) { w_align = 8; h_align = 8; }<commit_titl...
<vulnerable_code> has_dynamic_data, ) @type_check_wrapper def pack_arguments(signature, args, context, stmt_expr, is_external_call): # NOTE cyclic dep from vyper.old_codegen.abi import abi_encode, abi_type_of pos = getpos(stmt_expr) # abi encoding just treats all args as a big tuple args_tuple...
<vulnerable_code> */ char *redisProtocolToLuaType(lua_State *lua, char* reply) { char *p = reply; switch(*p) { if (atype == '%') { p = redisProtocolToLuaType(lua,p); } else { lua_pushboolean(lua,1); } lua_settable(lua,-3); /* Repl...
<vulnerable_code> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; User delegatedUser = delegatedUserHolder.get(); ...
<vulnerable_code> # encountering a comment -- but read_object assumes that # following the comment must be the object we're trying to # read. In this case, it could be an operator instead. while peek not in (b"\r", b"\n"): peek = stream...
<vulnerable_code> qcom->dwc3->dev.coherent_dma_mask = dev->coherent_dma_mask; child_res = kcalloc(2, sizeof(*child_res), GFP_KERNEL); if (!child_res) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { if (ret) { dev_err(&pdev->dev, "failed to add device\n"); device_remove_sof...
<vulnerable_code> raise exception.UserNotFound(user_id=user_id) user_ref = self.identity_api.update_user(context, user_id, user) return {'user': user_ref} def delete_user(self, context, user_id): return self.update_user(context, user_id, user) def set_user_password(self, co...
<vulnerable_code>from keystone.common import wsgi class AdminRouter(wsgi.ComposingRouter): def __init__(self): mapper = routes.Mapper() # If the user is disabled don't allow them to authenticate if not user_ref.get('enabled', True): raise exception.Forb...
<vulnerable_code> client.tokens.authenticate, token=token_id) def test_user_create_update_delete(self): from keystoneclient import exceptions as client_exceptions user = client.users.get(user.id) self.assertFalse(user.enabled) sel...
<vulnerable_code>import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.Objects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xwiki.model.reference.DocumentReference; import org.xwiki.security.authorization.Right; import com.xpn.xwiki.XWikiContext; import co...
<vulnerable_code> import org.xwiki.component.annotation.Role; import org.xwiki.model.reference.DocumentReference; import com.xpn.xwiki.XWikiException; * @throws XWikiException when failing to load the document revision */ XWikiDocument getRevision(XWikiDocument document, String revision) throws XWikiExc...
<vulnerable_code>import java.util.Locale; import org.apache.commons.lang3.StringUtils; import org.xwiki.localization.LocaleUtils; import org.xwiki.model.reference.DocumentReference; import org.xwiki.model.reference.DocumentReferenceResolver; { return batchId; } }<commit_title>[PATCH] XWIKI-16285: Error...
<vulnerable_code>import javax.inject.Provider; import javax.inject.Singleton; import org.xwiki.component.annotation.Component; import org.xwiki.component.manager.ComponentLookupException; import org.xwiki.component.manager.ComponentManager; import org.xwiki.model.reference.DocumentReference; import com.xpn.xwiki.XWik...
<vulnerable_code> import org.xwiki.component.annotation.Component; import org.xwiki.model.reference.DocumentReference; import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.XWikiException; } return null; } @Override { return getRevision(document != null ? document.getDocumentRe...
<vulnerable_code>import java.util.Date; import java.util.List; import java.util.Locale; import javax.inject.Inject; import javax.inject.Named; import org.xwiki.component.annotation.Component; import org.xwiki.component.manager.ComponentLookupException; import org.xwiki.component.manager.ComponentManager; import com.x...
<vulnerable_code>import java.util.Date; import org.xwiki.component.annotation.Role; import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.XWikiException; // unpredictable. deleteFromRecycleBin(new XWikiDocument(), index, context, bTransaction); } }<commit_title>[PATCH] XWIKI-16285: Error when ac...
<vulnerable_code>import org.xwiki.resource.entity.EntityResourceReference; import org.xwiki.resource.internal.DefaultResourceReferenceHandlerChain; import org.xwiki.script.ScriptContextManager; import org.xwiki.security.authorization.ContextualAuthorizationManager; import org.xwiki.security.authorization.Right; import ...
<vulnerable_code>import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.doc.XWikiDeletedDocument; import com.xpn.xwiki.doc.XWikiDocument; import com.xpn.xwiki.test.MockitoOldcore; import com.xpn.xwiki.test.junit5.mockito.InjectMockitoOldcore; import com.xpn.xwiki.test.junit5.mockito.OldcoreTest; @Mock private ...
<vulnerable_code> self.assertEqual(thread_results[0], [2]) self.assertEqual(main_results[0], [3]) def testBatchDecoratedWithCapturedInput(self): """Tests that the batch_function decorator works.""" if context.executing_eagerly():<commit_title>[PATCH] Fix check failure in Unbatch Op kernel by check...
<vulnerable_code> @Deprecated private static final String DEFAULT_COMMAND = "DROP SCHEMA IF EXISTS %s CASCADE"; private static final String DEFAULT_SQL_COMMAND = "DROP SCHEMA IF EXISTS %s CASCADE"; @Deprecated private static final Map<String, String> DB_COMMANDS = new HashMap<>();<commit_title>[PAT...
<vulnerable_code>import java.util.Date; import java.util.List; import javax.inject.Named; import org.xwiki.component.annotation.Component; import org.xwiki.query.Query; import org.xwiki.query.QueryException; import org.xwiki.rest.XWikiResource; import org.xwiki.rest.model.jaxb.History; import org.xwiki.rest.model.jax...
<vulnerable_code><commit_title>[PATCH] XWIKI-19997: Improved modifications rest endpoint history<commit_description><fixed_code> /* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * unde...
<vulnerable_code> VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, error = OT_ERROR_INVALID_STATE); VerifyOrExit(strlen(aPskd) <= Dtls::kPskMaxLength, error = OT_ERROR_INVALID_ARGS); RemoveJoiner(aEui64, 0); // remove immediately for (Joiner *joiner = &mJoiners[0]; joiner < OT_ARRAY_END(mJoiners);...
<vulnerable_code>{ Jsi_Value *target; if (Jsi_FunctionIsConstructor(funcPtr)) target = _this; else { Jsi_Obj *o = Jsi_ObjNewType(interp, JSI_OT_REGEXP);<commit_title>[PATCH] Fixes #62<commit_description>FossilOrigin-Name: ef9d33b5fa866924ce4876daaf706343aec976bc09de6eba0bcb15c7eef3b50d<...
<vulnerable_code>from django.db import connection from django.db.models.aggregates import Count from django.http import HttpResponse from django.contrib.contenttypes.models import ContentType from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.apps import apps f...
<vulnerable_code>from mindsdb.utilities.config import Config from mindsdb.utilities.context import context as ctx from mindsdb.utilities import log logger = log.getLogger(__name__) def on_file(file): nonlocal file_object data["file"] = file.file_name.decode() file_object =...
<vulnerable_code> from mindsdb.integrations.libs.base import BaseMLEngine from mindsdb.utilities.config import Config def _validate_prompt_template(prompt_template: str): if 'source_url_link' not in args['using']: raise Exception("SimpleWebPageReader requires a `source_url_link` parameter....
<vulnerable_code> HandlerResponse as Response, RESPONSE_TYPE ) from .urlcrawl_helpers import get_df_from_query_str, get_all_websites urls = url else: raise NotImplementedError( f'url can be url = "someurl", you can also crawl m...
<vulnerable_code><commit_title>[PATCH] fixes: - SSRF - arbitrary file write<commit_description><fixed_code> from urllib.parse import urlparse import socket import ipaddress def is_private_url(url: str): """ Raises exception if url is private :param url: url to check """ hostname = urlparse(url)....
<vulnerable_code> ).live_message_mention() if alert_msg: content = alert_msg # Stop bad things from happening here... content = content.replace("{stream.name}", str(stream.name)) # Backwards compatab...
<vulnerable_code># HTTP messages (protocol elements limited to exhaustively enumerated ASCII characters) # and Unicode string operations and pattern matching. # The re.ASCII merely switches character class semantics, it does NOT guard against incorrect use. _TCHAR_SPECIALS: Final[str] = "!#$%&'*+-.^_`|~" TOKENRE: Fin...
<vulnerable_code> 'command': [ { // FOR command pattern: /((?:^|[&(])[ \t]*)for(?: ?\/[a-z?](?:[ :](?:"[^"]*"|(?!")\S+))?)* \S+ in \([^)]+\) do/im, lookbehind: true, inside: { 'keyword': /^for\b|\b(?:in|do)\b/i, }, { // IF command pattern: /((?:^|[&(])[ \t]*)if(?: ?\/[a-z?](?:[ :]...
<vulnerable_code>!function(e){var r=/%%?[~:\w]+%?|!\S+!/,t={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},n=/"(?:[\\"]"|[^"])*"(?!")/,i=/(?:\b|-)\d+\b/;Prism.languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,look...
<vulnerable_code>static int sesman_data_in(struct trans *self) { int version; int size; { in_uint32_be(self->in_s, version); in_uint32_be(self->in_s, size); if (size > self->in_s->size) { LOG(LOG_LEVEL_ERROR, "sesman_data_in: bad message size"); retur...
<vulnerable_code> skb_pull(skb, (64 - dword_align_bytes)); if (rsi_prepare_beacon(common, skb)) { rsi_dbg(ERR_ZONE, "Failed to prepare beacon\n"); return -EINVAL; } skb_queue_tail(&common->tx_queue[MGMT_BEACON_Q], skb);<commit_title>[PATCH] rsi: release skb if rsi_prepare_beacon fails<commit_description>In rsi_...
<vulnerable_code> else sgt = obj->funcs->get_sg_table(obj); if (!sgt) return false; sgl = sgt->sgl;<commit_title>[PATCH] malidp: Fix NULL vs IS_ERR() checking<commit_description>The get_sg_table() function does not return NULL. It returns error pointers. Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Si...
<vulnerable_code>/*********************************************************************************************/ JsonApiJob::JsonApiJob(const AccountPtr &account, const QString &path, QObject *parent) : AbstractNetworkJob(account, path, parent) { } void JsonApiJob::addQueryParams(const QUrlQuery &params) { _a...
<vulnerable_code> from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes as dtypes_lib from tensorflow.python.framework import test_util from tensorflow.python.ops import array_ops from tensorflow.python.ops import gradient_checker_v2 from tensorflow.python.ops import linalg_...
<vulnerable_code>#include "futils.hpp" #include "types.hpp" #include "error.hpp" #include "http.hpp" #include "properties.hpp" { } //! Internal Pimpl structure of class FileIo. class FileIo::Impl { public:<commit_title>[PATCH] Avoid negative integer overflow when `filesize <<commit_description><fi...
<vulnerable_code> DataBuf chunkId(5); chunkId.pData_[4] = '\0' ; io_->read(data, WEBP_TAG_SIZE * 3); const uint32_t filesize = Exiv2::getULong(data + WEBP_TAG_SIZE, littleEndian) + 8; enforce(filesize <= io_->size(), Exiv2::kerCorruptedMetadata); } // WebPImage::readMetadat...
<vulnerable_code> RzBinSymbol *sym; RzListIter *iter; rz_list_foreach (bf->o->symbols, iter, sym) { if (sym->name[0] != '_') { continue; } const char *cn = sym->classname;<commit_title>[PATCH] fix oob read on luac<commit_description><fixed_code> RzBinSymbol *sym; RzListIter *iter; rz_list_foreach (bf->o->...
<vulnerable_code> } // 2.2 parse debug_upvalues size_t real_upvalue_cnt = rz_list_length(proto->upvalue_entries); if (real_upvalue_cnt > 0) { LuaDbgUpvalueEntry *debug_upv_entry; upvalue_names = RZ_NEWS0(char *, real_upvalue_cnt); LuaConstEntry *const_entry; rz_list_foreach (proto->const_entries, iter, const_...
<vulnerable_code> switch(tlv_subtype) { case LLDP_TLV_AA_ELEMENT_SUBTYPE: PEEK_BYTES(&msg_auth_digest, sizeof msg_auth_digest); aa_element_dword = PEEK_UINT32; break; case LLDP_TLV_AA_ISID_VLAN_ASGNS_SUBTYPE: ...
<vulnerable_code> def decode(self, jws, key='', verify=True, algorithms=None, options=None, **kwargs): payload, signing_input, header, signature = self._load(jws) if verify:<commit_title>[PATCH] Add warning when decoding with no algorithms specified<commit_description><fixed_code> ...
<vulnerable_code> def decode(self, jwt, key='', verify=True, algorithms=None, options=None, **kwargs): payload, signing_input, header, signature = self._load(jwt) decoded = super(PyJWT, self).decode(jwt, key, verify, algorithms,<commit_title>[PATCH] Add warning when decoding with no ...
<vulnerable_code> pytest.deprecated_call(jws.decode, example_jws, verify=False) def test_load_no_verification(self, jws, payload): right_secret = 'foo' jws_message = jws.encode(payload, right_secret)<commit_title>[PATCH] Add warning when decoding with no algorithms specified<commit_descript...
<vulnerable_code> secret, verify_expiration=True )<commit_title>[PATCH] Add warning when decoding with no algorithms specified<commit_description><fixed_code> secret, verify_expiration=True ) def test_decode_with_optional_algori...
<vulnerable_code>import org.json.JSONObject; import org.ohdsi.circe.helper.ResourceHelper; import org.ohdsi.webapi.util.PreparedStatementRenderer; import org.ohdsi.webapi.util.SourceUtils; import org.springframework.stereotype.Component; import org.ohdsi.featureExtraction.FeatureExtraction; ArrayList<String> clauses ...
<vulnerable_code> return Objects.nonNull(val) ? val.replaceAll("(^\"|\"$|^'|'$)", "") : val; } }<commit_title>[PATCH] fixes SQL injection vulnerability<commit_description><fixed_code> return Objects.nonNull(val) ? val.replaceAll("(^\"|\"$|^'|'$)", "") : val; } public static String escapeSql(String val) ...
<vulnerable_code> self.handler = hs.get_device_handler() self.media_repo = hs.get_media_repository_resource() self.server_name = hs.hostname self.clock = hs.clock self.admin_user = self.register_user("admin", "pass", admin=True) self.admin_user_tok = self.login("admin", "...
<vulnerable_code><commit_title>[PATCH 1/5] Fix typo in password_auth_providers doc<commit_description>A word got removed accidentally in 83434df3812650f53c60e91fb23c2079db0fb5b8.<fixed_code> # -*- coding: utf-8 -*- # Copyright 2020 The Matrix.org Foundation C.I.C. # # Licensed under the Apache License, Version 2.0 (the...
<vulnerable_code> # type in the list. (NB that the spec doesn't require us to do so and # clients which favour types that they don't understand over those that # they do are technically broken) login_types = [] if self._password_enabled: login_types.append(LoginType.PA...
<vulnerable_code> return mock_password_provider.check_auth(*args) def providers_config(*providers: Type[Any]) -> dict: """Returns a config dict that will enable the given password auth providers""" return { mock_password_provider.check_password.reset_mock() # first delete should give a...
<vulnerable_code> ) request.setHeader( b"Access-Control-Allow-Headers", b"Origin, X-Requested-With, Content-Type, Accept, Authorization", ) <commit_title>[PATCH 1/5] Fix typo in password_auth_providers doc<commit_description>A word got removed accidentally in 83434df3812650f53c60e91fb23c2079...
<vulnerable_code> if (ssid.length != 0) { if (ssid.length > sizeof(ssid.ssid) - 1) return 0; if (!ND_TTEST2(*(p + offset), ssid.length)) return 0; if (length < ssid.length) return 0; memcpy(&ssid.ssid, p + offset, ssid.length); offset += ssid.length; length -= ssid.length; i...
<vulnerable_code> s.add("org.apache.commons.dbcp.datasources.SharedPoolDataSource"); s.add("com.p6spy.engine.spy.P6DataSource"); DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s); } <commit_title>[PATCH] Fix #2498<commit_description><fixed_code> s.add("org.apache.commons....
<vulnerable_code> auto conditionOp = whileOp.getConditionOp(); for (const auto &it : llvm::enumerate(conditionOp.getArgs())) { if (!isa<TensorType>(it.value().getType())) continue; if (!state.areEquivalentBufferizedValues( it.value(), conditionOp->getBlock()->getArgument(it.ind...
<vulnerable_code> */ #include "fmacros.h" #include <stdlib.h> #include <string.h> #ifndef _MSC_VER static void *callbackValDup(void *privdata, const void *src) { ((void) privdata); redisCallback *dup = malloc(sizeof(*dup)); memcpy(dup,src,sizeof(*dup)); return dup; } void redisAsyncSetTimeout(redisAs...
<vulnerable_code> */ #include "fmacros.h" #include <stdlib.h> #include <assert.h> #include <limits.h> /* Create a new hash table */ static dict *dictCreate(dictType *type, void *privDataPtr) { dict *ht = malloc(sizeof(*ht)); _dictInit(ht,type,privDataPtr); return ht; } return DICT_ERR; /* All...
<vulnerable_code><commit_title>[PATCH] Safe allocation wrappers where we don't handle OOM<commit_description>See hiredis issues #747, #752<fixed_code> #include "fmacros.h" #include "hralloc.h" #include <string.h> void *hr_safe_malloc(size_t size) { void *ptr = malloc(size); if (ptr == NULL) HR_OOM_HAND...
<vulnerable_code> if (c->tcp.host != addr) { free(c->tcp.host); c->tcp.host = strdup(addr); } if (timeout) { if (c->timeout != timeout) { if (c->timeout == NULL) c->timeout = malloc(sizeof(struct timeval)); memcpy(c->timeout, timeout, sizeof(...
<vulnerable_code> return; } nlocks = CRYPTO_num_locks(); ossl_locks = malloc(sizeof(*ossl_locks) * nlocks); for (ii = 0; ii < nlocks; ii++) { sslLockInit(ossl_locks + ii); }<commit_title>[PATCH] Safe allocation wrappers where we don't handle OOM<commit_description>See hiredis issues #...
<vulnerable_code>from ubireader.ubifs.misc import decompress from ubireader.debug import error, log, verbose_log def extract_files(ubifs, out_path, perms=False): """Extract UBIFS contents to_path/ return inode = inodes[dent_node.inum] dent_path = os.path.join(path, dent_node.name) if...
<vulnerable_code> return _wrap_response(DeleteRegisteredModelTag.Response()) def _validate_source(source: str, run_id: str) -> None: if is_local_uri(source): if run_id: INVALID_PARAMETER_VALUE, ) @catch_mlflow_exception @_disable_if_artifacts_only<commit_title>[PATCH] Disable abil...
<vulnerable_code> def test_create_model_version_with_path_source(mlflow_client): name = "mode" mlflow_client.create_registered_model(name) exp_id = mlflow_client.create_experiment("test") run = mlflow_client.create_run(experiment_id=exp_id) assert "To use a local path as a model version" in respons...
<vulnerable_code> colormap=(PixelPacket *) AcquireQuantumMemory(image->colors, sizeof(*colormap)); if (colormap == (PixelPacket *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); j=0; colormap[j]=image->colormap[0]; for (i=0; i < (ssize_t) image->colors; ...
<vulnerable_code>// See the License for the specific language governing permissions and // limitations under the License. #include "BlackboxTests.hpp" #include "PubSubReader.hpp" #include "PubSubWriter.hpp" #include "DatagramInjectionTransport.hpp" #include <gtest/gtest.h> #include <fastdds/rtps/transport/UDPv4Tran...
<vulnerable_code> L.showModal(_('Delete key'), [ E('div', _('Do you really want to delete the following SSH key?')), E('pre', delkey), E('div', { class: 'right' }, [ E('div', { class: 'btn', click: L.hideModal }, _('Cancel')), ' ',<commit_title>[PATCH] luci-mod-system: fix potential stored XSS<commit_descr...
<vulnerable_code> !siz->tileheight || !siz->numcomps || siz->numcomps > 16384) { return -1; } if (!(siz->comps = jas_alloc2(siz->numcomps, sizeof(jpc_sizcomp_t)))) { return -1; }<commit_title>[PATCH] Ensure that not all tiles lie outside the image area.<commit_description><fixed_code> !siz->tileheight || !s...
<vulnerable_code> dec->tilexoff = siz->tilexoff; dec->tileyoff = siz->tileyoff; dec->numcomps = siz->numcomps; if (!(dec->cp = jpc_dec_cp_create(dec->numcomps))) { return -1; }<commit_title>[PATCH] Ensure that not all tiles lie outside the image area.<commit_description><fixed_code> dec->tilexoff = siz->tilexoff...