text
stringlengths
79
3.72M
<vulnerable_code> */ package io.micronaut.core.convert.value; import io.micronaut.core.convert.ConversionContext; import io.micronaut.core.convert.ConversionService; import io.micronaut.core.reflect.GenericTypeUtils; return Optional.empty(); } /** * Find a header and convert it to the given type....
<vulnerable_code> * @return True if it is */ default boolean contains(String name) { return get(name, Object.class).isPresent(); } /**<commit_title>[PATCH] Use ConversionContext constants where possible instead of<commit_description><fixed_code> * @return True if it is */ def...
<vulnerable_code> */ public interface Argument<T> extends TypeVariableResolver, AnnotatedElement, Type { /** * Constant for int argument. Used by generated code, do not remove. */ @SuppressWarnings("unused") Argument INT = Argument.of(int.class); /** * Constant for long argument. Used b...
<vulnerable_code> * @param genericTypes The generic types */ public DefaultArgument(Class<T> type, String name, AnnotationMetadata annotationMetadata, Argument... genericTypes) { this.type = type; this.name = name; this.annotationMetadata = annotationMetadata != null ? annotat...
<vulnerable_code> } else if (mediaType.equals(MediaType.APPLICATION_VND_ERROR_TYPE)) { return Argument.of(VndError.class); } else { return Argument.of(String.class); } } }<commit_title>[PATCH] Use ConversionContext constants where possible instead of<commit_description...
<vulnerable_code> private static final Logger LOG = LoggerFactory.getLogger(RoutingInBoundHandler.class); private static final Pattern IGNORABLE_ERROR_MESSAGE = Pattern.compile( "^.*(?:connection.*(?:reset|closed|abort|broken)|broken.*pipe).*$", Pattern.CASE_INSENSITIVE); private final Router ro...
<vulnerable_code>public class CompletableFutureBodyBinder extends DefaultBodyAnnotationBinder<CompletableFuture> implements NonBlockingBodyArgumentBinder<CompletableFuture> { private final BeanLocator beanLocator; private final HttpServerConfiguration httpServerConfiguration; @Override public Arg...
<vulnerable_code>public class PublisherBodyBinder extends DefaultBodyAnnotationBinder<Publisher> implements NonBlockingBodyArgumentBinder<Publisher> { private static final Logger LOG = LoggerFactory.getLogger(NettyHttpServer.class); private final BeanLocator beanLocator; private final HttpServerConfigurat...
<vulnerable_code>import static io.micronaut.http.HttpHeaders.VARY; import io.micronaut.core.async.publisher.Publishers; import io.micronaut.core.order.Ordered; import io.micronaut.core.type.Argument; import io.micronaut.core.util.StringUtils; import io.micronaut.http.HttpHeaders; import io.micronaut.http.HttpMethod; @...
<vulnerable_code> */ package io.micronaut.http.server.cors; import io.micronaut.core.convert.ConversionContext; import io.micronaut.core.convert.TypeConverter; import io.micronaut.core.convert.value.ConvertibleValues; import io.micronaut.http.HttpMethod; import javax.inject.Singleton; import java.util.Map; import jav...
<vulnerable_code> */ package io.micronaut.http; import io.micronaut.core.convert.ConversionService; import io.micronaut.core.type.Headers; * @return An {@link Optional} of {@link Integer} */ default Optional<Integer> findInt(CharSequence name) { return get(name, Integer.class); } /** ...
<vulnerable_code> */ package io.micronaut.http; import io.micronaut.core.annotation.TypeHint; import io.micronaut.core.convert.ConversionService; import io.micronaut.core.naming.NameUtils; import io.micronaut.core.util.StringUtils; import io.micronaut.core.value.OptionalValues; import io.micronaut.http.annotation.Prod...
<vulnerable_code> Object[] params = resolveParams(context, cacheable.get(MEMBER_PARAMETERS, String[].class, StringUtils.EMPTY_STRING_ARRAY)); Object key = keyGenerator.generateKey(context, params); CompletableFuture<Object> thisFuture = new CompletableFuture<>(); Argument<...
<vulnerable_code>import io.micronaut.context.condition.Condition; import io.micronaut.context.condition.ConditionContext; import io.micronaut.core.annotation.Introspected; import io.micronaut.core.type.Argument; import io.micronaut.core.util.CollectionUtils; import java.io.File; if (beanContext instanceof Appl...
<vulnerable_code>@Requires(classes = HttpServerConfiguration.class) public class SessionArgumentBinder implements TypedRequestArgumentBinder<Session> { private final SessionStore<Session> sessionStore; /** @Override public Argument<Session> argumentType() { return Argument.of(Session.class); ...
<vulnerable_code> channel_mask; char key[MagickPathExtent], *value; const char *attribute, *keyword; double msl_info->attributes[n],(const char *) attributes[i], exception); CloneString(&value,attribute); switch (*keyword) ...
<vulnerable_code># -*- coding: utf-8 -* from flask import Flask,render_template, redirect, url_for, request, flash, get_flashed_messages , send_from_directory import requests import os from requests.exceptions import ReadTimeout # 文件下载 @app.route("/<path:url>/<path:filename>") def downloader(url,filename): dirpath...
<vulnerable_code> if(Object.keys(req.files).length !== 0){ pic_path = req.files.fileUpload.path; }else{ var base64Data = req.body.replace(/^data:image\/png;base64,/, ""); fs.writeFile("out.png", base64Data, 'base64', function(err) { console.log(err); }); } <commit_title>[PATCH] fml<commit_d...
<vulnerable_code> deepEqual( $( "#" + element.data( "ui-tooltip-id" ) ).text(), "anchortitle" ); }); test( "content: return string", function() { expect( 1 ); var element = $( "#tooltipped1" ).tooltip({<commit_title>[PATCH] Tooltip: Escape the title attribute so that it's treated as<commit_description><fixed_code> ...
<vulnerable_code> version: "@VERSION", options: { content: function() { return $( this ).attr( "title" ); }, hide: true, // Disabled elements have inconsistent behavior across browsers (#8661)<commit_title>[PATCH] Tooltip: Escape the title attribute so that it's treated as<commit_description><fixed_code> v...
<vulnerable_code> dprintk("%s: write %Zd bytes\n", bd->name, count); bsg_set_block(bd, file); bytes_written = 0;<commit_title>[PATCH] sg_write()/bsg_write() is not fit to be called under<commit_description><fixed_code> dprintk("%s: write %Zd bytes\n", bd->name, count); if (unlikely(segment_eq(get_fs(), KERNEL_...
<vulnerable_code> sg_io_hdr_t *hp; unsigned char cmnd[SG_MAX_CDB_SIZE]; if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) return -ENXIO; SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp,<commit_title>[PATCH] sg_write()/bsg_write() is not fit to be called under<commit_description><fixed_code> s...
<vulnerable_code>#define T_HASH_SIZE 8192 /* must be power of 2 */ #define T_MUTEX_SIZE 64 static struct tdirent *t_hashtable[T_HASH_SIZE]; static kmutex_t t_hashmutex[T_MUTEX_SIZE]; * to see if it has been removed while it was unlocked. */ if (op == DE_LINK || op == DE_RENAME) { if (tp != dir) rw_enter(...
<vulnerable_code> case 16: z2=z = ReadBlobXXXLong(image2); /* 4D matrix animation */ if(z!=3 && z!=1) ThrowReaderException(CoderError, "MultidimensionalMatricesAreNotSupported"); Frames = ReadBlobXXXLong(image2); break; default: ThrowReaderException(CoderError, "Multid...
<vulnerable_code>int fscrypt_process_policy(struct inode *inode, const struct fscrypt_policy *policy) { if (policy->version != 0) return -EINVAL; <commit_title>[PATCH] fscrypto: add authorization check for setting encryption<commit_description><fixed_code> int fscrypt_process_policy(struct inode *inode, cons...
<vulnerable_code> * to check if an extension header is present. This is expedient, * however not all implementations set the length field proper. */ if (!ext_dp->icmp_length) { vec[0].ptr = (const uint8_t *)(const void *)&ext_dp->icmp_ext_version_res; ...
<vulnerable_code>} const queryTable = (surveyId, editMode, nodeDefUuidTable, tableName, nodeDefUuidCols, cols, offset = 0, filter = null, sort = null) => console.log(DataSort.getHttpParam(sort)) || axios.post( `/api/surveyRdb/${surveyId}/${tableName}/query`, { nodeDefUuidTable,<commit_title>[PATCH] Delet...
<vulnerable_code> // search for the body for ( size_t b = 0 ; bSearching && b < lengthof(blankLines) ; b++ ) { if ( strstr(buffer,blankLines[b]) ) { bSearching = false ; body = (int) ( strstr(buffer,blankLines[b]) - bu...
<vulnerable_code> result = await userRepo.aggregate(agt) result = result.length > 0 ? result[0] : null result.secret = randomKey const responseMessage = { message: result.username + ' was successfully created.', created: result } const payload = { action: 'create_user', ...
<vulnerable_code> } } debug('comparator', comp, options) this.options = options this.loose = !!options.loose module.exports = Comparator const parseOptions = require('../internal/parse-options') const { re, t } = require('../internal/re') const cmp = require('../functions/cmp') const debug = requ...
<vulnerable_code> this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range .split('||') // map the range to a 2d array of comparators .map(r => this.parseRange(r.trim())) // thro...
<vulnerable_code>const debug = require('../internal/debug') const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') const { re, t } = require('../internal/re') const parseOptions = require('../internal/parse-options') const { compareIdentifiers } = require('../internal/identifiers')<commit_title>[PAT...
<vulnerable_code>const SemVer = require('../classes/semver') const parse = require('./parse') const { re, t } = require('../internal/re') const coerce = (version, options) => { if (version instanceof SemVer) {<commit_title>[PATCH] fix: better handling of whitespace<commit_description><fixed_code> const SemVer = requ...
<vulnerable_code> // The actual regexps go on exports.re const re = exports.re = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ debug(name, index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isG...
<vulnerable_code><commit_title>[PATCH] fix: better handling of whitespace<commit_description><fixed_code> const { test } = require('tap') const Range = require('../../classes/range') const SemVer = require('../../classes/semver') const Comparator = require('../../classes/comparator') const validRange = require('../../r...
<vulnerable_code>const { test } = require('tap') const { src, re } = require('../../internal/re') const semver = require('../../') test('has a list of src, re, and tokens', (t) => { for (const i in semver.tokens) { t.match(semver.tokens[i], Number, 'tokens are numbers') } t.end() })<commit_title>[PATCH] fix:...
<vulnerable_code>const t = require('tap') // ensure that the coverage map maps all coverage const ignore = [ '.git', '.github', '.commitlintrc.js', '.eslintrc.js', '.eslintrc.local.js', 'node_modules', 'coverage', 'tap-snapshots', 'test', 'fixtures', ] const { statSync, readdirSync } = require('fs...
<vulnerable_code> /* if the alias is stored we enforce it (implicit overrides explicit) */ if (alias && alias_len && (alias_len != (int)tmp_len || strncmp(alias, buffer, tmp_len))) { buffer[tmp_len] = '\0'; php_stream_close(fp); if (signature) { } if (error) { spprintf(error, 0, "cannot load p...
<vulnerable_code> switch( act->Type ) { case PUSH_STRING: t=malloc(strlen(act->p.String)+3); /* 2 "'"s and a NULL */ strcpy(t,"'"); strcat(t,act->p.String); switch( act->Type ) { case PUSH_STRING: /* STRING */ t=malloc(strlen(act->p.String)+3); /* strcpy(t,"\""); strcat(t,act->p.String); strca...
<vulnerable_code> const u_char *ep = ndo->ndo_snapend; ND_PRINT((ndo, " wb-prep:")); if (len < sizeof(*prep)) { return (-1); } n = EXTRACT_32BITS(&prep->pp_n); ps = (const struct pgstate *)(prep + 1); while (--n >= 0 && ND_TTEST(*ps)) { case PT_ID: if (wb_id(ndo, (const struct pkt_id *)(ph + 1), len) >= 0) ...
<vulnerable_code> pj_uint8_t xmac[PJSIP_AKA_MACLEN]; pjsip_cred_info aka_cred; int i, len; pj_status_t status; /* Check the algorithm is supported. */ if (chal->algorithm.slen==0 || pj_stricmp2(&chal->algorithm, "md5") == 0) { /* * A normal MD5 authentication is requested. Fallbackt to the us...
<vulnerable_code> * Create response digest based on the parameters and store the * digest ASCII in 'result'. */ PJ_DEF(void) pjsip_auth_create_digest( pj_str_t *result, const pj_str_t *nonce, const pj_str_t *nc, const pj_str_t *cnonce, const pj_str_t *qop, const ...
<vulnerable_code> if (pj_stricmp(&hdr->scheme, &pjsip_DIGEST_STR) == 0) { char digest_buf[PJSIP_MD5STRLEN]; pj_str_t digest; const pjsip_digest_credential *dig = &hdr->credential.digest; /* Check that username and realm match. digest.slen = PJSIP_MD5STRLEN; /* Create digest for comparison. */ pjsip_auth_cr...
<vulnerable_code> if (tp_id == PJSUA_INVALID_ID) return; pj_assert(tp_id >= 0 && tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata)); tpdata = &pjsua_var.tpdata[tp_id]; flag = pjsip_transport_get_flag_from_type(tpdata->type);<commit_title>[PATCH] Use PJ_ASSERT_RETURN() on pjsip_auth_create_digest() and<comm...
<vulnerable_code> app.get('/section/:id', function(req, res) { var id = req.params.id; var query = connection.query('SELECT Section.id, Section.name AS secname, Section.description AS secdesc, Survey.title AS stitle, Survey.description AS sdesc, Survey.id AS sid, Survey.holder from Section,Survey WHERE Survey.secti...
<vulnerable_code>*/ app.all('/survey/:id', function(req, res) { var id = req.params.id; var sql ='SELECT Survey.id as sid, Survey.title AS stitle, Survey.description AS sdesc, Question.id AS qid, Item.id AS iid,question, item from Survey, Question, Item where Survey.id=' + connection.escape(id) +' AND Survey.status...
<vulnerable_code> if issubclass(exc_type, UNAUTHORIZED): if ignore: return NotAuthorized request.session.clear() if not handled: LOG.debug("Unauthorized: %s" % exc_value) # We get some pretty useless error messages back from<commit_title>[PATCH] Fixes lp978...
<vulnerable_code> Adds a :class:`~horizon.users.User` object to ``request.user``. """ request.__class__.user = users.LazyUser() request.horizon = {'dashboard': None, 'panel': None} <commit_title>[PATCH] Fixes lp978896 -- Session fixation security fix<commit_description>Rotates session to...
<vulnerable_code># License for the specific language governing permissions and limitations # under the License. from django import http from django.core.urlresolvers import reverse from keystoneclient import exceptions as keystone_exceptions self.assertRedirectsNoFollow(res, reverse('splash')) s...
<vulnerable_code> # If any of those keys are missing from the session it is # overwhelmingly likely that we're dealing with an outdated session. LOG.exception("Error while creating User from session.") request.session.clear() raise exceptions.NotAuthorized(_("Your session has expi...
<vulnerable_code> def logout(request): """ Clears the session and logs the current user out. """ request.session.clear() # FIXME(gabriel): we don't ship a view named splash return shortcuts.redirect('splash')<commit_title>[PATCH] Fixes lp978896 -- Session fixation security fix<commit_description>Rotates...
<vulnerable_code> self.fields['region'].widget = forms.widgets.HiddenInput() def handle(self, request, data): # For now we'll allow fallback to OPENSTACK_KEYSTONE_URL if the # form post doesn't include a region. endpoint = data.get('region', None) or settings.OPENSTACK_KEYSTONE_U...
<vulnerable_code>MSG_USERAUTH_GSSAPI_RESPONSE, MSG_USERAUTH_GSSAPI_TOKEN = range(60, 62) MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, MSG_USERAUTH_GSSAPI_ERROR,\ MSG_USERAUTH_GSSAPI_ERRTOK, MSG_USERAUTH_GSSAPI_MIC = range(63, 67) MSG_GLOBAL_REQUEST, MSG_REQUEST_SUCCESS, MSG_REQUEST_FAILURE = range(80, 83) MSG_CHANNEL_OPE...
<vulnerable_code> MSG_CHANNEL_FAILURE, MSG_CHANNEL_DATA, MSG_CHANNEL_EXTENDED_DATA, MSG_CHANNEL_WINDOW_ADJUST, MSG_CHANNEL_REQUEST, MSG_CHANNEL_EOF, MSG_CHANNEL_CLOSE, MIN_WINDOW_SIZE, MIN_PACKET_SIZE, MAX_WINDOW_SIZE, DEFAULT_WINDOW_SIZE, DEFAULT_MAX_PACKET_SIZE, ) from paramiko.compress import ZlibComp...
<vulnerable_code>import sys import pprint import base64 import posixpath import socket import ssl import wsgiref.simple_server from urlparse import urlparse # pylint: enable=F0401,E0611 from . import auth, config, ical, log, rights, storage, xmlutils VERSION = "1.0.1" def sanitize_uri(uri): """Unquot...
<vulnerable_code><commit_title>[PATCH] Move sanitize_path into pathutils.py<commit_description><fixed_code> # -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
<vulnerable_code> if (length > row_size + 256) // arbitrary number { pixels=(unsigned char *) RelinquishMagickMemory(pixels); ThrowBinaryException(ResourceLimitError,"InvalidLength", image->filename); } compact_pixels=(unsigned char *) AcquireQuantumMemory(length,sizeof(*pixels)); ...
<vulnerable_code> fp->stage = FILE_COMMIT; else *failedFile = xstrdup(fp->fpath); } } fi = rpmfiFree(fi); /* Walk backwards in case we need to erase */ fi = rpmfilesIter(files, RPMFI_ITER_BACK); while ((fx = rpmfiNext(fi)) >= 0) { struct filedata_s *fp = &fdata[fx]; /* Run fsm file post ...
<vulnerable_code> }); }); protocol.registerSchemesAsPrivileged([ { scheme: 'tw-extensions', privileges: { supportFetchAPI: true } } ]); app.whenReady().then(() => { protocol.registerFileProtocol('tw-extensions', (request, callback) => { const pathAndQuery = request.url.substring('tw-exten...
<vulnerable_code>import {isBackgroundThrottlingEnabled, whenBackgroundThrottlingChanged} from './background-throttling'; import './extensions'; import {createAtomicWriteStream} from './atomic-file-write-stream'; const readFile = util.promisify(fs.readFile); const brotliDecompress = util.promisify(zlib.brotliDecompress...
<vulnerable_code>const readFile = promisify(fs.readFile); const decompress = promisify(brotliDecompress); protocol.registerSchemesAsPrivileged([ { scheme: 'tw-library-files', privileges: { supportFetchAPI: true } } ]); const mimeTypes = new Map(); mimeTypes.set('wav', 'audio/wav'); mimeTypes.set...
<vulnerable_code><commit_title>[PATCH] Fix some bugs related to protocols and file: URIs<commit_description><fixed_code> import {protocol} from 'electron'; protocol.registerSchemesAsPrivileged([ { scheme: 'tw-extensions', privileges: { supportFetchAPI: true } }, { scheme: 'tw-library-files'...
<vulnerable_code><commit_title>[PATCH] Fix some bugs related to protocols and file: URIs<commit_description><fixed_code> import {app} from 'electron'; const isRequestAllowed = (details) => { const url = new URL(details.url); if (url.protocol === 'file:') { // Requests to files must be inside the application ...
<vulnerable_code> g_str_has_prefix(argv[i],"--exclude-from") || g_str_has_prefix(argv[i],"--files-from")) { good_option++; } else if (argv[i][0] != '-') { /* argument values are accounted for here */ good_option++; } }<commit_title>[PATCH] fix : account for as a valid argument to --file<commit_desc...
<vulnerable_code> */ protected void onRequestRows(int firstRowIndex, int numberOfRows, int firstCachedRowIndex, int cacheSize) { setPushRows(Range.withLength(firstRowIndex, numberOfRows)); markAsDirty(); } /** * Triggered when rows have been dropped from the client side...
<vulnerable_code> if (mode->indent_level < MAX_INDENT_LEVEL) tbl->indent -= INDENT_INCR; } offset = tbl->indent; if (cmd == HTML_DT) { if (mode->indent_level > 0 && mode->indent_level <= MAX_INDENT_LEVEL) offset -= INDENT_INCR; } if (tbl->indent > 0) { check_minimum0(tbl, 0);<commit_titl...
<vulnerable_code> } } /* -=[Process Response Phase]=- */ status = libspdm_append_message_a(spdm_context, spdm_request, spdm_request_size); if (LIBSPDM_STATUS_IS_ERROR(status)) {<commit_title>[PATCH] Prevent undefined behavior<commit_description>Fix #2068 in 2.3 branch. Signed-off-by: Steven Bel...
<vulnerable_code> if (extend_error_data->request_code != original_request_code) { return LIBSPDM_STATUS_INVALID_MSG_FIELD; } spdm_context->error_data.rd_exponent = extend_error_data->rd_exponent; spdm_context->error_data.request_code = extend_error_data->request_code; spdm_context->error_dat...
<vulnerable_code> if (spdm_context->crypto_request) { timeout = spdm_context->local_context.capability.rtt + ((uint64_t)2 << spdm_context->connection_info.capability.ct_exponent); } else { timeout = spdm_context->local_context.capability.rtt + spdm_context->lo...
<vulnerable_code> response_size, response); } } libspdm_reset_message_buffer_via_request_code(spdm_context, NULL, spdm_request->header.request_response_code);<commit_title>[PATCH] Prevent undefined behav...
<vulnerable_code>TPM_GENERATED_Unmarshal(TPM_GENERATED *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT32_Unmarshal(target, buffer, size); if (rc == TPM_RC_SUCCESS) { if (*target != TPM_GENERATED_VALUE) { rc = TPM_RC_VALUE; } } retur...
<vulnerable_code> let elLegendText = document.createElement('span') elLegendText.classList.add('apexcharts-legend-text') elLegendText.innerHTML = Array.isArray(text) ? text.join(' ') : text let textColor = w.config.legend.labels.useSeriesColors ? w.globals.colors[i]<commit_title>[PATCH]...
<vulnerable_code>import Formatters from '../Formatters' import DateTime from '../../utils/DateTime' import Utils from './Utils' /** * ApexCharts Tooltip.Labels Class to draw texts on the tooltip. if (w.globals.yLabelFormatters[0]) { yLbFormatter = w.globals.yLabelFormatters[0] } else { yLb...
<vulnerable_code> class Utils { static bind(fn, me) { return function() { return fn.apply(me, arguments) } } // credit: http://stackoverflow.com/questions/27936772/deep-object-merging-in-es6-es7#answer-34749873 static extend(target, source) { if (typeof Object.assign !== 'function') { ;(...
<vulnerable_code> * @type {object} filesystemCredentials.ssh Holds SSH credentials. * @type {string} filesystemCredentials.ssh.publicKey The public key. Default empty string. * @type {string} filesystemCredentials.ssh.privateKey The private key. Default empty string. * @type {bool} file...
<vulnerable_code>!function(a,b,c){var d=a(document);b=b||{},b.updates={},b.updates.ajaxNonce=c.ajax_nonce,b.updates.l10n=c.l10n,b.updates.searchTerm="",b.updates.shouldRequestFilesystemCredentials=!1,b.updates.filesystemCredentials={ftp:{host:"",username:"",password:"",connectionType:""},ssh:{publicKey:"",privateKey:""...
<vulnerable_code> self.logger.debug(f"_import status: {import_stdout}") if m is None and allow_noop: return None assert m is not None, f"Config version not found: {import_stdout}" version = int(m.group(1)) return version def _export_import_modify_one(self, befor...
<vulnerable_code> # request makes further api requests app.run(host='0.0.0.0', port=settings.config.api_port, debug=True, threaded=True, use_reloader=False, ssl_context=context)<commit_title>[PATCH] rbd-target-api: disable the built-in werkzeug debugger...
<vulnerable_code><commit_title>[PATCH] add access control support for admin service<commit_description><fixed_code> package com.ctrip.framework.apollo.adminservice; import com.ctrip.framework.apollo.adminservice.filter.AdminServiceAuthenticationFilter; import com.ctrip.framework.apollo.biz.config.BizConfig; import org...
<vulnerable_code><commit_title>[PATCH] add access control support for admin service<commit_description><fixed_code> package com.ctrip.framework.apollo.adminservice.filter; import com.ctrip.framework.apollo.biz.config.BizConfig; import com.google.common.base.Splitter; import com.google.common.base.Strings; import java....
<vulnerable_code> } @Value("${local.server.port}") int port; protected String url(String path) { return "http://localhost:" + port + path;<commit_title>[PATCH] add access control support for admin service<commit_description><fixed_code> } @Value("${local.server.port}") protected int port; protect...
<vulnerable_code><commit_title>[PATCH] add access control support for admin service<commit_description><fixed_code> package com.ctrip.framework.apollo.adminservice.filter; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; im...
<vulnerable_code><commit_title>[PATCH] add access control support for admin service<commit_description><fixed_code> package com.ctrip.framework.apollo.adminservice.filter; import com.ctrip.framework.apollo.adminservice.controller.AbstractControllerTest; import com.ctrip.framework.apollo.common.config.RefreshableProper...
<vulnerable_code> return defaultValue; } }<commit_title>[PATCH] add access control support for admin service<commit_description><fixed_code> return defaultValue; } public boolean isAdminServiceAccessControlEnabled() { return getBooleanProperty("admin-service.access.control.enabled", false); } pu...
<vulnerable_code>import com.ctrip.framework.apollo.util.http.HttpUtil; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.util.concurrent.SettableFuture; import java.lang.reflect.Type; import java.util.List; Map<String, String> headers = request.getHe...
<vulnerable_code>import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.net.UrlEscapers; import com.google.common.util.concurrent.SettableFuture; import com.google.gson.Gson; Map<String, String> headers = request.get...
<vulnerable_code>import com.ctrip.framework.apollo.configservice.util.AccessKeyUtil; import com.ctrip.framework.apollo.core.signature.Signature; import com.ctrip.framework.apollo.core.utils.StringUtils; import java.io.IOException; import java.util.List; import java.util.Objects; List<String> availableSecrets = acce...
<vulnerable_code>import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; /** * @author nisiyong when(accessKeyUtil.findAvailableSecret(appId)).thenReturn(secrets); when(accessKeyUtil.buildSignature(any(), any(), any(), any())).thenReturn(availableSignature); ...
<vulnerable_code>package com.ctrip.framework.apollo.core.signature; import com.google.common.collect.Maps; import java.net.MalformedURLException; import java.net.URL; import java.util.Map; private static final String AUTHORIZATION_FORMAT = "Apollo %s:%s"; private static final String DELIMITER = "\n"; public sta...
<vulnerable_code>import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.Map; import org.junit.Test; Map<String, String> actualHttpHeaders = Signature.buildHttpHeaders(url, appId, secret); assertTrue(actualHttpHeaders.containsKey(Signature.HTTP_HEADER_AUTHORI...
<vulnerable_code>import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author Jason Song(song_s@ctrip.com) HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) resp; ...
<vulnerable_code>package com.ctrip.framework.apollo.portal.component; import com.ctrip.framework.apollo.common.exception.ServiceException; import com.ctrip.framework.apollo.portal.environment.PortalMetaDomainService; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.portal.enviro...
<vulnerable_code> return getBooleanProperty(SystemRoleManagerService.MANAGE_APP_MASTER_LIMIT_SWITCH_KEY, false); } /*** * The following configurations are used in ctrip profile **/<commit_title>[PATCH] add access control support for admin service<commit_description><fixed_code> return getBooleanProper...
<vulnerable_code> if (!query) { //如果不传这个参数或者false则返回到首页(参数出错) if (!notJumpToHomePage) { $window.location.href = '/index.html'; } else { return {}; }<commit_title>[PATCH] add access control support for admi...
<vulnerable_code>import javax.servlet.FilterChain; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; String someToken = "someToken"; Long someConsumerId = 1L; ...
<vulnerable_code>package com.ctrip.framework.apollo.portal; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo...
<vulnerable_code> return 0; } /** * sys_perf_event_open - open a performance event, associate it to a task/cpu * } if (move_group) { gctx = group_leader->ctx; mutex_lock_double(&gctx->mutex, &ctx->mutex); if (gctx->task == TASK_TOMBSTONE) { err = -ESRCH; goto err_locked; } } else { mutex_lock(&ct...
<vulnerable_code> tcp_set_ca_state(sk, TCP_CA_Open); tcp_clear_retrans(tp); inet_csk_delack_init(sk); tcp_init_send_head(sk); memset(&tp->rx_opt, 0, sizeof(tp->rx_opt)); __sk_dst_reset(sk);<commit_title>[PATCH] tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0<commit_description>When tcp_disconnect() is called, ...
<vulnerable_code> uint32_t n = (uint32_t)VALUE_AS_INT(GET_VALUE(1)); gravity_list_t *list = gravity_list_new(vm, n); for (uint32_t i=0; i<n; ++i) marray_push(gravity_value_t, list->array, VALUE_FROM_NULL); RETURN_VALUE(VALUE_FROM_OBJECT(list), rindex); gravity_string_t *main_str = VALUE_AS_S...
<vulnerable_code> DEBUG_VM("LISTNEW %d %d", r1, n); gravity_list_t *list = gravity_list_new(vm, n); SETVALUE(r1, VALUE_FROM_OBJECT(list)); DISPATCH(); }<commit_title>[PATCH] Fix for https://github.com/marcobambini/gravity/issues/132<commit_description><fixed_code> DEBUG_VM("LISTNEW %d %d", r1...