text
stringlengths
79
3.72M
<vulnerable_code> from flask_caching.backends.base import BaseCache try: import cPickle as pickle except ImportError: # pragma: no cover import pickle # type: ignore logger = logging.getLogger(__name__) try: remove = False with open(fname, "rb") as f: ...
<vulnerable_code> from flask_caching.backends.base import BaseCache, iteritems_wrapper try: import cPickle as pickle except ImportError: # pragma: no cover import pickle # type: ignore _test_memcached_key = re.compile(r"[^\x00-\x21\xff]{1,250}$").match # I didn't found a good way to avoid pickling...
<vulnerable_code>""" from flask_caching.backends.base import BaseCache, iteritems_wrapper try: import cPickle as pickle except ImportError: # pragma: no cover import pickle # type: ignore class RedisCache(BaseCache): """Uses the Redis key-value store as a cache backend. t = type(value) ...
<vulnerable_code> from flask_caching.backends.base import BaseCache try: import cPickle as pickle except ImportError: # pragma: no cover import pickle # type: ignore logger = logging.getLogger(__name__) if not expired: hit_or_miss = "hit" try: ...
<vulnerable_code> from flask_caching.backends.base import BaseCache try: import cPickle as pickle except ImportError: # pragma: no cover import pickle # type: ignore class UWSGICache(BaseCache): """ Implements the cache using uWSGI's caching framework. rv = self._uwsgi.cache_get(key, self.cache...
<vulnerable_code><commit_title>[PATCH] Security Fix<commit_description><fixed_code> function toggleWriteability(id_of_patient, checked) { document.getElementById(id_of_patient).disabled = checked; } // vim: et sw=4 sts=4
<vulnerable_code><commit_title>[PATCH] Security Fix<commit_description><fixed_code> var alphabet = 'a!`=[]\\;\':"/<> &'; var out = document.getElementById('out'); var testContainer = document.getElementById('testContainer'); function print(s) { out.value += s + "\n"; } function testImage() { re...
<vulnerable_code> switch (ie_type) { case MFR_CTRL_IE_MAGIC_NUM: ND_PRINT((ndo, "0x%08x", EXTRACT_32BITS(tptr))); break; <commit_title>[PATCH] (for 4.9.3) CVE-2018-14468/FRF.16: Add a missing length<commit_description><fixed_code> switch (ie_type) { ...
<vulnerable_code>import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.function.Supplier; import java.util.stream.Collectors; if (updateFromClientFilter != null && !updateFromClientFilter.test(key)) { getLogger().war...
<vulnerable_code> Assert.assertEquals(NEW_VALUE, element.getPropertyRaw(TEST_PROPERTY)); } @Test public void noSyncPropertiesFeature_doesntThrow() { StateNode noSyncProperties = new StateNode(ElementPropertyMap.class); ElementPropertyMap map = noSyncProperties<commit_title>[PATCH] M...
<vulnerable_code> if (gf_list_count(mov->moov->trackList) == 1 && gf_list_count(mov->moof->TrackList) == 1) { GF_TrackFragmentBox *traf = (GF_TrackFragmentBox*)gf_list_get(mov->moof->TrackList, 0); GF_TrackBox *trak = (GF_TrackBox*)gf_list_get(mov->moov->trackList, 0); if ((traf->tfhd->trackID != trak->Header->tr...
<vulnerable_code> * @return {@link RestResult} */ @GetMapping(value = "/derby") public RestResult<Object> derbyOps(@RequestParam(value = "sql") String sql) { String selectSign = "select"; String limitSign = "ROWS FETCH NEXT";<commit_title>[PATCH] fix derbyOps interface security problem<...
<vulnerable_code> } private static boolean hasEditRights(SecurityContext securityContext) { if (securityContext.isUserInRole(Authentication.ROLE_ADMIN) || securityContext.isUserInRole(Authentication.ROLE_REST)) { return true; } else { return false;<commit_title>[PATCH] NM...
<vulnerable_code>// don't let users crawl up the folder structure by using a/../../../c/d var cleanUrl = function(url) { url = decodeURIComponent(url); while(url.indexOf('..').length > 0) { url = url.replace('..', ''); } return url; }; <commit_title>[PATCH] Fix canonicalization of directories<commit_description><fi...
<vulnerable_code> } } /* Iterate thr' all leaf cfs_rq's on a runqueue */ #define for_each_leaf_cfs_rq_safe(rq, cfs_rq, pos) \ list_for_each_entry_safe(cfs_rq, pos, &rq->leaf_cfs_rq_list, \ leaf_cfs_rq_list) /* Do the two (enqueued) entities belong to the same group ? */ static inline struct cfs_rq * { } #def...
<vulnerable_code> return false; } for (i = 0; i < settings->num_players; ++i) { if (!NET_ReadInt8(packet, (unsigned int *) &settings->player_classes[i]))<commit_title>[PATCH] net: fix missing server-side num_players validation<commit_description><fixed_code> ...
<vulnerable_code> break; /* corrupt EXIF */ tag_value=(ssize_t) ReadProfileShort(endian,q); format=(ssize_t) ReadProfileShort(endian,q+2); if ((format-1) >= EXIF_NUM_FORMATS) break; components=(ssize_t) ReadProfileLong(endian,q+4); if (components < 0)<commit_title>[PATCH] h...
<vulnerable_code>from signedjson.sign import SignatureVerifyException from sydent.http.httpclient import FederationHttpClient from sydent.util.stringutils import is_valid_hostname logger = logging.getLogger(__name__) if not json_request["signatures"]: raise NoAuthenticationError("Missing X-Matrix...
<vulnerable_code>from sydent.http.servlets import get_args, jsonwrap, deferjsonwrap, send_cors from sydent.http.httpclient import FederationHttpClient from sydent.users.tokens import issueToken from sydent.util.stringutils import is_valid_hostname logger = logging.getLogger(__name__) matrix_server = args['ma...
<vulnerable_code> from sydent.threepid import ThreepidAssociation from sydent.util.stringutils import is_valid_hostname from twisted.internet import defer matrix_server = mxid_parts[1] if not is_valid_hostname(matrix_server): logger.error( "MXID server part '%s' not a va...
<vulnerable_code># See the License for the specific language governing permissions and # limitations under the License. import re # https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-register-email-requesttoken client_secret_regex = re.compile(r"^[0-9a-zA-Z\.\=\_\-]+$") # hostname/domain name + o...
<vulnerable_code> class RegisterTestCase(unittest.TestCase): """Tests Sydent's register servlet""" def setUp(self): # Create a new sydent self.sydent = make_sydent()<commit_title>[PATCH] Allow IPv6 literals as Matrix server names.<commit_description>According to the spec, Matrix server names are...
<vulnerable_code>from twisted.trial import unittest from sydent.util.stringutils import is_valid_hostname class UtilTests(unittest.TestCase): """Tests Sydent utility functions.""" def test_is_valid_hostname(self): """Tests that the is_valid_hostname function accepts only valid hostnames (or do...
<vulnerable_code> with self.cached_session(): self._assert_sparse_tensor_empty(self.evaluate(out)) class SparseCrossHashedOpTest(BaseSparseCrossOpTest): <commit_title>[PATCH] Fix check failure in SparseCrossV2Op by adding check for<commit_description><fixed_code> with self.cached_session(): self._a...
<vulnerable_code> *messages=(char *) ResizeQuantumMemory(*messages,offset+length+1, sizeof(char *)); } (void) memcpy(*messages+offset,message,length); (*messages)[length+offset] ='\0'; return(length);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/722<commit_description><f...
<vulnerable_code> if not code_validations.allow_imports and has_imports: raise ValueError(f"Generated code has disallowed imports: {code}") if not code_validations.allow_command_exec: for node in ast.walk(code_tree): if ( isinstance(node, ast.C...
<vulnerable_code> return result """ _MATH_SOLUTION_INFINITE_LOOP = """ def solution(): \"\"\"Michael had 58 golf balls. On tuesday, he lost 23 golf balls. assert output == "33" def test_math_question_infinite_loop() -> None: """Test simple question.""" question = """Michael had 58 golf balls. On ...
<vulnerable_code> { c=XBMInteger(image,hex_digits); if (c < 0) break; *p++=(unsigned char) c; if ((padding == 0) || (((i+2) % bytes_per_line) != 0)) *p++=(unsigned char) (c >> 8); { c=XBMInteger(image,hex_digits); if (c < 0) break; *p++=(unsigned ...
<vulnerable_code> */ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct && sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0 ){ p->selFlags &= ~SF_Distinct; pGroupBy = p->pGroupBy = sqlite3ExprListDup(db, pEList, 0);<commit_title>[PATCH] Fix a crash that could occur if a sub-select that us...
<vulnerable_code> } else if (chunkType == "iCCP") { // The ICC profile name can vary from 1-79 characters. uint32_t iccOffset = 0; while (iccOffset < 80 && iccOffset < chunkLength) { if (chunkData.pData_[iccOffset++] == 0...
<vulnerable_code> }); }); describe('existing session, but not passing a callback argument', function() { var passport = new Passport(); passport.serializeUser(function(user, done) {<commit_title>[PATCH] Add tests.<commit_description><fixed_code> }); }); describe('existin...
<vulnerable_code> else: loader = 0 # Copy over data elif source.location == "memory": loader = ["mload", ["add", "_pos", ["mul", 32, ["mload", MemoryPositions.FREE_LOOP_INDEX]]]] elif source.location == "storage": loader = ["sload", ["add", "_pos", ["mload", MemoryPosition...
<vulnerable_code>#include "image_int.hpp" #include "basicio.hpp" #include "error.hpp" #include "futils.hpp" #include "types.hpp" } profileName_ = std::string(reinterpret_cast<char *>(chunkData.pData_), iccOffset-1); ++iccOffset; // +1 = 'compressed' flag ...
<vulnerable_code> } else { ret = std::mbrtowc(&wc, &in[in_pos], in_len - in_pos, &state); // Determine whether to encode this character with our crazy scheme. if (wc >= ENCODE_DIRECT_BASE && wc < ENCODE_DIRECT_BASE + 256) { use_encode_direct = true; ...
<vulnerable_code>def side_effect(old_cmd, command): with tarfile.TarFile(_tar_file(old_cmd.script_parts)[0]) as archive: for file in archive.getnames(): try: os.remove(file) except OSError:<commit_title>[PATCH] NA: Fix possible changes in files outside of working<comm...
<vulnerable_code>def side_effect(old_cmd, command): with zipfile.ZipFile(_zip_file(old_cmd), 'r') as archive: for file in archive.namelist(): try: os.remove(file) except OSError:<commit_title>[PATCH] NA: Fix possible changes in files outside of working<commit_descript...
<vulnerable_code> self.on('entry', function(entry) { if (entry.type == 'Directory') return; entry.pipe(Writer({ path: path.join(opts.path,entry.path) })) .on('error',function(e) { self.emit('error',e);<commit_title>[PATCH] fix: prevent extracting archived files outside of target path<commi...
<vulnerable_code> }); } }); });<commit_title>[PATCH] fix: prevent extracting archived files outside of target path<commit_description><fixed_code> }); } }); }); test("do not extract zip slip archive", function (t) { var archive = path.join(__dirname, '../testData/zip-slip/zip-slip.zip'); te...
<vulnerable_code> # gr.load() to prevent SSRF or harvesting of HF tokens by malicious Spaces. is_safe_url = any(url.host.endswith(root) for root in self.blocks.root_urls) if not is_safe_url: raise ValueError("This URL cannot be proxied.") headers = {} if Context.hf_tok...
<vulnerable_code> # Adapted from: https://github.com/tiangolo/fastapi/issues/1788 try: rp_req = app.build_proxy_request(url_path) except ValueError as err: raise HTTPException(status_code=400, detail=str(err)) rp_resp = await client.send(rp_...
<vulnerable_code> */ public abstract class AbstractJBossMarshaller extends AbstractMarshaller implements StreamingMarshaller { private static final Log log = LogFactory.getLog(AbstractJBossMarshaller.class); private static final boolean trace = log.isTraceEnabled(); protected static final JBossMarshallerFacto...
<vulnerable_code> hotrod = server; hotrodClient = new RemoteCacheManager(new ConfigurationBuilder() .addServers("localhost:" + hotrod.getPort()) .addJavaSerialWhiteList(".*Person.*") .marshaller(marshaller) .build()); hotrodCache = cacheName.isEmpty()<com...
<vulnerable_code> url.rstrip("/") if isinstance(url, str) else None ) # url must not end with a slash self.hs_token = hs_token self.sender = sender self.namespaces = self._check_namespaces(namespaces) self.id = id True if the application service is interes...
<vulnerable_code> NotFoundError, StoreError, SynapseError, UserDeactivatedError, ) from synapse.api.ratelimiting import Ratelimiter from synapse.handlers.ui_auth import ( return None (user_id, password_hash) = lookupres # If the password hash is None, the account has likely b...
<vulnerable_code>from authlib.jose import JsonWebToken, JWTClaims from authlib.jose.errors import BadSignatureError, InvalidClaimError, JoseError from synapse.api.errors import Codes, LoginError, StoreError, UserDeactivatedError from synapse.types import JsonDict, UserID if TYPE_CHECKING: class JwtHandler: def __...
<vulnerable_code> LoginError, NotApprovedError, SynapseError, ) from synapse.api.ratelimiting import Ratelimiter from synapse.api.urls import CLIENT_API_PREFIX def __init__(self, hs: "HomeServer"): super().__init__() self.hs = hs # JWT configuration variables. self.jwt_en...
<vulnerable_code> GF_FilterPacket *pck; u8 *output; gf_bs_get_content_no_truncate(ctx->state.bs, &ctx->state.frame_obus, &pck_size, &ctx->state.frame_obus_alloc); if (!pck_size) {<commit_title>[PATCH] fixed #1719<commit_description><fixed_code> GF_FilterPacket *pck; u8 *output; if (!ctx->opid) return GF_NON_...
<vulnerable_code> * @return {Object|Array} The field value. */ function SetOrGet(input, field, def) { return input[field] = Deffy(input[field], def); } <commit_title>[PATCH] Security fix for Prototype Pollution<commit_description><fixed_code> * @return {Object|Array} The field value. */ function SetOrGet(input, ...
<vulnerable_code> } else if (v->type == MSGPACK_OBJECT_EXT) { quote = FLB_TRUE; val = o->via.ext.ptr; val_len = o->via.ext.size; } if (!val || !key) {<commit_title>[PATCH] flb_pack: fix OSS-...
<vulnerable_code> } @Test public void testEmailValidatorWithFaultyString() { Assert.assertFalse(validator.isValid("a@a.m5qRt8zLxQG4mMeu9yKZm5qRt8zLxQG4mMeu9yKZm5qRt8zLxQG4mMeu9yKZ&")); } <commit_title>[PATCH] Corrected test name<commit_description><fixed_code> } @Test public void te...
<vulnerable_code> } }, { pattern: /(\s*)(?:=+ +)+=+(?:(?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1(?:=+ +)+=+(?=(?:\r?\n|\r){2}|\s*$)/, lookbehind: true, inside: { 'punctuation': /[=-]+/<commit_title>[PATCH] Rest: Faster `table` pattern<commit_description><fixed_code> } }, { pattern: /(\s*)=+ [ =]*=(?:...
<vulnerable_code>Prism.languages.rest={table:[{pattern:/(\s*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1[+|].+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/,lookbehind:!0,inside:{punctuation:/\||(?:\+[=-]+)+\+/}},{pattern:/(\s*)(?:=+ +)+=+(?:(?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1(?:=+ +)+=+(?=(?:\r?\n|\r){2}|\s*$)/,lookbehind:!0,inside:{punctuatio...
<vulnerable_code> if not image_url: return # Don't attempt to download the URL if it is blocked. if self._is_url_blocked(image_url): return # The image URL from the HTML might be relative to the previewed page, # convert it to an URL which can be requeste...
<vulnerable_code>import org.openqa.selenium.By; import org.xwiki.flamingo.skin.test.po.AttachmentsPane; import org.xwiki.flamingo.skin.test.po.AttachmentsViewPage; import org.xwiki.model.reference.DocumentReference; import org.xwiki.rest.model.jaxb.Page; import org.xwiki.test.docker.junit5.TestConfiguration; import org...
<vulnerable_code>import org.xwiki.user.UserReference; import org.xwiki.user.UserReferenceResolver; import org.xwiki.velocity.VelocityManager; import com.fasterxml.jackson.databind.ObjectMapper; import com.xpn.xwiki.XWiki; protected String localizePlainOrKey(String key, Object... parameters) { return S...
<vulnerable_code> for (EntityReference singleReference : spaceReference.removeParent(wikiReference).getReversedReferenceChain()) { path.add(singleReference.getName()); } if (reference.getType() == EntityType.DOCUMENT) { path.add(reference.getName()); } retu...
<vulnerable_code> return false; } /** * Use the following keyboard shortcut and wait for a new page to load. This should be only used for shortcuts that * indeed loads a new page.<commit_title>[PATCH] XWIKI-20339: Attachments name are not properly displayed with<commit_description><fixed_code>...
<vulnerable_code> } data['post_id'] = Watu.post_id; // no ajax? In this case only return true to allow submitting the form if(e && e.no_ajax && e.no_ajax.value == 1) return true; <commit_title>[PATCH] Fixed security exploit<commit_description>git-svn-id: https://plugins.svn.wordpress.org/watu/trunk@1290960 b845...
<vulnerable_code> return ret; out_release_unlock: spin_unlock(ptl); out_release_nounlock: if (vm_shared) unlock_page(page); put_page(page); goto out; }<commit_title>[PATCH] userfaultfd: hugetlbfs: remove superfluous page unlock in<commit_description><fixed_code> return ret; out_release_unlock: spin_unlock(ptl);...
<vulnerable_code> */ package org.xwiki.administration.test.ui; import java.util.List; import java.util.stream.Stream; import org.junit.jupiter.api.Order; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import...
<vulnerable_code> */ package org.xwiki.test.ui.po; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; { this.submitButton.click(); } }<commit_title>[PATCH] XWIKI-21173: Improve escaping in registration success message<commit_description>* Use $xwiki.getUserName to link t...
<vulnerable_code> if (userinfo_end) { result->userinfo = uri; result->userinfo_len = userinfo_end - uri; /* shift host part beyond userinfo and '@' */ result->host += result->userinfo_len + 1; result->host_len -= result->userinfo_len + 1; } } /* consume userinfo, if a...
<vulnerable_code> return NULL; } /* do not allow empty host if userinfo or port are set */ if ((result->host_len == 0) && (result->userinfo || result->port)) { return NULL; } /* this includes the '/' */ return authority_end; }<commit_title>[PATCH 3/5] uri_parser: do not ...
<vulnerable_code> } } /* parsing the path, starting with '/' */ return _parse_relative(result, uri, uri_end); } bool uri_parser_is_absolute(const char *uri, size_t uri_len)<commit_title>[PATCH 3/5] uri_parser: do not parse path if end-of-uri<commit_description><fixed_code> } } /* i...
<vulnerable_code> return -1; } if (has_authority) { uri = _consume_authority(result, uri, uri_end); if (uri == NULL) {<commit_title>[PATCH 3/5] uri_parser: do not parse path if end-of-uri<commit_description><fixed_code> return -1; } if (uri >= uri_end) { /* nothi...
<vulnerable_code> 0), VEC("coap://R@////////////////7///v=1", true, "", "", "", "", "", "", "", "", -1), VEC("coa[:////[2001:db5ow:5own/Ov=1", false, "", "", "", 0), }; static char _fa...
<vulnerable_code> // Delete vm.showDeleteConfirmationModal = false; // Reset vm.showResetConfirmationModal = false; // Error messages vm.deleteProjectFail = false; vm.deleteProjectSuccess = false; vm.resetProjectFail = false; vm.resetProjectSucces...
<vulnerable_code><commit_title>[PATCH] Do not apply cascade deletion on message model<commit_description>Change circleci deployment branches Enable RDS Cloudwatch Logging and transactional logs Change ASG Policy to Target Request Count threshold Include into migration a cleanup for task_ids on messages for tasks, wh...
<vulnerable_code><commit_title>[PATCH] Do not apply cascade deletion on message model<commit_description>Change circleci deployment branches Enable RDS Cloudwatch Logging and transactional logs Change ASG Policy to Target Request Count threshold Include into migration a cleanup for task_ids on messages for tasks, wh...
<vulnerable_code><commit_title>[PATCH] Do not apply cascade deletion on message model<commit_description>Change circleci deployment branches Enable RDS Cloudwatch Logging and transactional logs Change ASG Policy to Target Request Count threshold Include into migration a cleanup for task_ids on messages for tasks, wh...
<vulnerable_code><commit_title>[PATCH] Do not apply cascade deletion on message model<commit_description>Change circleci deployment branches Enable RDS Cloudwatch Logging and transactional logs Change ASG Policy to Target Request Count threshold Include into migration a cleanup for task_ids on messages for tasks, wh...
<vulnerable_code> */ angular .module('taskingManager') .controller('projectController', ['$timeout', '$interval', '$scope', '$location', '$routeParams', '$window', '$q', 'moment', 'configService', 'mapService', 'projectService', 'styleService', 'taskService', 'geospatialService', 'editorService'...
<vulnerable_code>import geojson, io from flask import send_file from flask_restful import Resource, current_app, request from schematics.exceptions import DataError from distutils.util import strtobool from server.models.dtos.project_dto import ProjectSearchDTO, ProjectSearchBBoxDTO from server.services.project_search_...
<vulnerable_code>import os from dotenv import load_dotenv class EnvironmentConfig: """ Base class for configuration. """ """ Most settings can be defined through environment variables. """ APP_BASE_URL = os.getenv('TM_APP_BASE_URL', 'http://127.0.0.1:5000') # The default tag used in the OSM change...
<vulnerable_code>import json from typing import Optional from cachetools import TTLCache, cached import geojson from flask import current_app from geoalchemy2 import Geometry from sqlalchemy.dialects.postgresql import ARRAY from sqlalchemy.orm.session import make_transient from geoalchemy2.shape import to_shape import...
<vulnerable_code>import json from enum import Enum from flask import current_app from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound from sqlalchemy.orm.session import make_transient from geoalchemy2 import Geometry from server import db from typing import List from server.models.dtos.mapping_dto import ...
<vulnerable_code>from flask import current_app from geoalchemy2 import shape from server import db from server.models.dtos.mapping_dto import TaskDTO, MappedTaskDTO, LockTaskDTO, StopMappingTaskDTO, TaskCommentDTO from server.models.postgis.project import Project from server.models.postgis.statuses import MappingNotAl...
<vulnerable_code>from cachetools import TTLCache, cached from sqlalchemy import func from geoalchemy2.shape import to_shape from shapely.geometry import Polygon from shapely.ops import transform from functools import partial import pyproj import dateutil.parser import datetime import math from flask import current_app ...
<vulnerable_code>import dateutil.parser import datetime from server import db from server.models.dtos.user_dto import UserDTO, UserOSMDTO, UserFilterDTO, UserSearchQuery, UserSearchDTO, \ UserStatsDTO @staticmethod def register_user(osm_id, username, changeset_count): """ Creates user in DB...
<vulnerable_code>import unittest from unittest.mock import patch from server.services.stats_service import StatsService, TaskStatus, TaskHistory from server.models.postgis.project import Project from server.models.postgis.user import User test_user.tasks_mapped = 0 # Act StatsService._set_coun...
<vulnerable_code> get_instance_id, get_subscription, ) from ..onefuzzlib.request import ok from ..onefuzzlib.versions import versions def main(req: func.HttpRequest) -> func.HttpResponse: response = ok( Info( resource_group=get_base_resource_group(), ) return response<commit_ti...
<vulnerable_code> import azure.functions as func # This endpoint handles the signalr negotation # As we do not differentiate from clients at this time, we pass the Functions runtime # provided connection straight to the client def main(req: func.HttpRequest, connectionInfoJson: str) -> func.HttpResponse: return ...
<vulnerable_code> def fetch(cls) -> "InstanceConfig": entry = cls.get(get_instance_name()) if entry is None: entry = cls() entry.save() return entry <commit_title>[PATCH] Merge pull request from GHSA-q5vh-6whw-x745<commit_description>* verify aad tenants, primarily nee...
<vulnerable_code># Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from typing import Optional from uuid import UUID import azure.functions as func import jwt from onefuzztypes.enums import ErrorCode from onefuzztypes.models import Error, Result, UserInfo def get_bearer_token(request: func.Ht...
<vulnerable_code> import os import unittest from uuid import uuid4 from onefuzztypes.models import UserInfo user2 = uuid4() # no admins set self.assertTrue(can_modify_config_impl(InstanceConfig(), UserInfo())) # with oid, but no admin self.assertTrue( can_modify_c...
<vulnerable_code> set_app_audience, update_pool_registration, ) from set_admins import update_admins # Found by manually assigning the User.Read permission to application # registration in the admin portal. The values are in the manifest under multi_tenant_domain: str, upgrade: bool, sub...
<vulnerable_code> table_service.create_table(TABLE_NAME) def update_admins( table_service: TableService, resource_group: str, admins: List[UUID] ) -> None: parser = argparse.ArgumentParser(formatter_class=formatter) parser.add_argument("resource_group") parser.add_argument("storage_account") ...
<vulnerable_code> EventFileAdded(container=Container("container-name"), filename="example.txt"), EventNodeHeartbeat(machine_id=UUID(int=0), pool_name=PoolName("example")), EventTaskHeartbeat(task_id=UUID(int=0), job_id=UUID(int=0), config=task_config), EventInstanceConfigUpdated(config=In...
<vulnerable_code> # if set, only admins can manage pools or scalesets allow_pool_management: bool = Field(default=True) def update(self, config: "InstanceConfig") -> None: for field in config.__fields__: # If no admins are set, then ignore setting admins raise ValueError("adm...
<vulnerable_code> class TestInstanceConfig(unittest.TestCase): def test_with_admins(self) -> None: no_admins = InstanceConfig(admins=None) with_admins = InstanceConfig(admins=[UUID(int=0)]) with_admins_2 = InstanceConfig(admins=[UUID(int=1)]) no_admins.update(with_admins) se...
<vulnerable_code> gf_node_get_field(r->ToNode, r->ToField.fieldIndex, &inf); /*IS to another proto*/ if (r->ToNode->sgprivate->tag == TAG_ProtoNode) return gf_sg_proto_field_is_sftime_offset(r->ToNode, &inf); /*IS to a startTime/stopTime field*/ if (!stricmp(inf.name, "startTime") || !stricmp(inf.name, "stopT...
<vulnerable_code> var chalk = require('chalk'); var execSync = require('child_process').execSync; var path = require('path'); var execOptions = { } function getProcessIdOnPort(port) { return execSync('lsof -i:' + port + ' -P -t -sTCP:LISTEN', execOptions) .split('\n')[0] .trim(); }<commit_title>[PATCH] Upda...
<vulnerable_code>} namespace { constexpr char accountProperty[] = "account"; const char e2e_cert[] = "_e2e-certificate"; const char e2e_private[] = "_e2e-private"; const char e2e_mnemonic[] = "_e2e-mnemonic"; constexpr qint64 blockSize = 1024; QList<QByteArray> oldCipherFormatSplit(const QBy...
<vulnerable_code> struct kvm_lapic_irq irq; struct kvm_vcpu *vcpu; struct vcpu_data vcpu_info; int idx, ret = -EINVAL; if (!kvm_arch_has_assigned_device(kvm) || !irq_remapping_cap(IRQ_POSTING_CAP) || idx = srcu_read_lock(&kvm->irq_srcu); irq_rt = srcu_dereference(kvm->irq_routing, &kvm->irq_srcu); BUG_ON(gue...
<vulnerable_code> case '7': case '8': case '9': case '+': case '-': case '.': if (state->ptr == tmp) { return tmp; } /* no break */ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': default: if (!(mb = parse_mb(state, PARSE_SCHEME, state->ptr, state->end, tmp, 1))) { /* s...
<vulnerable_code> 'python-keystoneclient==3.10.0', 'python-heatclient==1.6.1', 'python-novaclient==7.1.2', 'paramiko==2.1.5', 'apscheduler==3.5.1', ], entry_points={<commit_title>[PATCH] Bump paramiko version<commit_description>The server-side vulnerability in Paramiko 2.1...
<vulnerable_code> var quicklink_list = ''; $.each(data, (index) => { if (typeof data[index]['name'] !== 'undefined') quicklink_list += '<li><a href="' + data[index]['link'] + '&token=' + data[index]['token'] + '"><i class="icon-chevron-right"></i> ' + data[index]['na...
<vulnerable_code> let i let j if (value === undefined || typeof value === 'boolean' || typeof value === 'object') { // Cannot escape on these values return value } else if (typeof value === 'number') { // Value is a number, no reason to escape return `${value}` } else {<commit_title>[PATCH] refactor e...
<vulnerable_code>static uid_t client_uid = (uid_t)-1L; static bool dir_is_in_dump_location(const char *dump_dir_name) { unsigned len = strlen(g_settings_dump_location); if (strncmp(dump_dir_name, g_settings_dump_location, len) == 0 && dump_dir_name[len] == '/' /* must not contain "/." anywhere (IOW:...
<vulnerable_code> log_info("problem id: '%s'", problem_id); return problem_id; }<commit_title>[PATCH] lib: add functions validating dump dir<commit_description>Move the code from abrt-server to shared library and fix the condition validating dump dir's path. As of now, abrt is allowed to process only direct sub...