text stringlengths 79 3.72M |
|---|
<vulnerable_code>from wger.utils.api_token import create_token
from wger.utils.permissions import WgerPermission
logger = logging.getLogger(__name__)
"""
Returns the application's version
"""
permission_classes = (AllowAny,)
@staticmethod
def get(request):
"""
Returns the minimum req... |
<vulnerable_code>import re
from datetime import timedelta
"""
This file contains the global settings that don't usually need to be changed.
For a full list of options, visit:<commit_title>[PATCH 01/16] implementing jwt token for rest api<commit_description><fixed_code>
import re
from datetime import timedelta
"""
Th... |
<vulnerable_code># Third Party
from django_email_verification import urls as email_urls
from rest_framework import routers
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView
# wger
from wger.core.api import views as core_api_views
from wger.utils.generic_views import Text... |
<vulnerable_code>
static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
{
qreal x0 = 0, y0 = 0; // starting point
qreal x = 0, y = 0; // current point
char lastMode = 0;
const QChar *str = dataStr.constData();
const QChar *end = str + dataStr.size()... |
<vulnerable_code> if (bufflen > 0 && bufflen < (size_t)len)
return GIT_EBUFS;
line += PKT_LEN_SIZE;
/*
* TODO: How do we deal with empty lines? Try again? with the next<commit_title>[PATCH] smart_pkt: verify packet length exceeds PKT_LEN_SIZE<commit_description>Each packet line in the Git protocol is prefixed by... |
<vulnerable_code> """
global DEMO_UUID_BASE
if os.getenv("DEMO_UUID_REQUESTING_NONRANDOM") == "NONRANDOM_REQUESTED":
warnings.warn(
"Environment variable DEMO_UUID_REQUESTING_NONRANDOM is deprecated. See case_utils.local_uuid._demo_uuid for usage notes on its replacement, CASE_DEMO_NONR... |
<vulnerable_code> var toHash = ''
if (date !== null) {
toHash += date.toString(36) + '-' + salt
}
return toHash + '-' + hash(toHash + '-' + secret)
}
<commit_title>[PATCH] Always pass down the salt<commit_description><fixed_code>
var toHash = ''
if (date !== null) {
toHash += date.toString(36) + '... |
<vulnerable_code>#!/bin/env python
from flask import Flask
from flask import flash,request,send_file,send_from_directory,redirect,render_template, abort
from werkzeug.utils import secure_filename
from ipaddress import ip_address, ip_network
https://stackoverflow.com/questions/23718236/python-flask-browsing-through-dir... |
<vulnerable_code> return dir;
}
/* Determine if the user (non-anon) needs a default root dir other than /. */
static int get_default_root(pool *p, int allow_symlinks, const char **root) {
config_rec *c = NULL;
if (allow_symlinks == FALSE) {
char *path, target_path[PR_TUNABLE_PATH_MAX + 1];
st... |
<vulnerable_code> });
describe('for an SSO connection', () => {
it.only('passes connectionScopes to the connection', () => {
lock = l.setup('__lock__', 'client', 'domain', {
auth: {
connectionScopes: {
});
describe('for a non-SSO connection', () => {
it.only('passes connectionSc... |
<vulnerable_code> expect(syncSpy).toHaveBeenCalledTimes(1);
});
});
});<commit_title>[PATCH] Merge pull request from GHSA-jr3j-whm4-9wwm<commit_description>* Convert svg strings to elements
* Sanitizing usage of dangerouslySetInnerHTML
Co-authored-by: David <david.patrick@auth0.com><fixed_code>
expec... |
<vulnerable_code>import React from 'react';
import Immutable, { Map } from 'immutable';
import { format } from 'util';
import sync from './sync';
import * as l from './core/index';
import { dataFns } from './utils/data_utils';
export function html(m, keyPath, ...args) {
const html = str(m, keyPath, ...args);
retu... |
<vulnerable_code>import static org.eclipse.jetty.http.CookieCompliance.Violation.Listener;
/**
* Cookie parser
*/
public interface CookieParser
{
static CookieParser newParser(CookieCompliance compliance, Listener complianceListener)
{
if (compliance == CookieCompliance.RFC6265_LEGACY || compliance.a... |
<vulnerable_code>import org.dspace.builder.CommunityBuilder;
import org.dspace.builder.EPersonBuilder;
import org.dspace.builder.GroupBuilder;
import org.dspace.content.Collection;
import org.dspace.content.Community;
import org.dspace.content.factory.ContentServiceFactory;
}
}<commit_title>[PATCH 1/3] Add tests ... |
<vulnerable_code> /**
* This method will return the name to give to the group created by the
* {@link #createDefaultReadGroup(Context, Collection, String, int)} method
*
* @param collection The DSpace collection to use in the name generation
* @param typeOfGroupString The type of gro... |
<vulnerable_code> assertFalse(groupService.isMember(context, adminChild1, adminGroup));
}
}<commit_title>[PATCH 1/3] Add tests against permission escalation<commit_description><fixed_code>
assertFalse(groupService.isMember(context, adminChild1, adminGroup));
}
@Test
/**
* Test for ... |
<vulnerable_code> return MY_CONSTANT[i]
"""
assert_compile_failed(lambda: get_contract(code), TypeMismatch)<commit_title>[PATCH] Merge pull request from GHSA-3p37-3636-q8wv<commit_description>in dynarray_make_setter, the length is copied before the data. when the
dst and src arrays do not overlap, this is no... |
<vulnerable_code> max_bytes = src.typ.maxlen
ret = ["seq"]
# store length
ret.append(STORE(dst, len_))
dst = bytes_data_ptr(dst)
src = bytes_data_ptr(src)
ret.append(copy_bytes(dst, src, len_, max_bytes))
return b1.resolve... |
<vulnerable_code> static String PARSER_INPUT_ENC_DETECT_IOERR() {
return localize("parser.input.enc.detect.ioerr");
}
static String DUPLICATE_KEY(String name) {
return localize("parser.duplicate.key", name);
}<commit_title>[PATCH] Eexception message moved to messages bundle in<commit... |
<vulnerable_code>
private void push(Context context) {
if (++size >= limit) {
throw new RuntimeException("Input is too deeply nested " + size);
}
context.next = head;
head = context;<commit_title>[PATCH] Eexception message moved to messages bundle ... |
<vulnerable_code> if (skb->ip_summed != CHECKSUM_COMPLETE)
return;
if (offset != 0)
csum = csum_sub(csum,
csum_partial(skb_transport_header(skb) + tlen,
offset, 0));
put_cmsg(msg, SOL_IP, IP_CHECKSUM, sizeof(__wsum), &csum);
}<commit_title>[PATCH] ip: fix IP_CHECKSUM handling<commit_description>Th... |
<vulnerable_code>static bool add_free_nid(struct f2fs_sb_info *sbi, nid_t nid, bool build)
{
struct f2fs_nm_info *nm_i = NM_I(sbi);
struct free_nid *i;
struct nat_entry *ne;
int err;
/* 0 nid should not be used */
if (unlikely(nid == 0))
return false;
if (build) {
/* do not add allocated nids */
ne = __l... |
<vulnerable_code> * 'hostHeaderName', 'localtimeOffsetMsec', 'host', 'port'
*/
exports.authenticateBewit = function (req, credentialsFunc, options, callback) {
callback = Hoek.nextTick(callback);
// Extract bewit
// 1 2 3 4
const resource = ... |
<vulnerable_code>};
// Extract host and port from request
// $1 $2
return null;
}
const hostParts = hostHeader.match(internals.hostHeaderRegex);
if (!hostParts) {
return null;
};
// Parse Hawk HTTP Authorization head... |
<vulnerable_code> });
});
describe('authenticateMessage()', () => {
it('errors on invalid authorization (ts)', (done) => {<commit_title>[PATCH] Fix minor DoS attack on long headers or uris. Closes #168<commit_description><fixed_code>
});
});
describe('authenticateBewit()', () =... |
<vulnerable_code> expect(host.name).to.equal('[123:123:123]');
done();
});
});
describe('version()', () => {<commit_title>[PATCH] Fix minor DoS attack on long headers or uris. Closes #168<commit_description><fixed_code>
expect(host.name).to.equal('[123:123:123]');
... |
<vulnerable_code> printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
continue;
}
#endif /* HAVE_LIBGCRYPT */
printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
continue;
}
#endif /* HAVE_LIBGCRYPT */
DEBUG ("network plugin: parse_packet: Unknown pa... |
<vulnerable_code>{
struct intr_source intr_src;
if (entry->irte_idx < CONFIG_MAX_IR_ENTRIES) {
if (entry->intr_type == PTDEV_INTR_MSI) {
intr_src.is_msi = true;
intr_src.src.msi.value = entry->phys_sid.msi_id.bdf;
} else {
intr_src.is_msi = false;
intr_src.src.ioapic_id = ioapic_irq_to_ioapic_id(entr... |
<vulnerable_code> dmar_unit = ioapic_to_dmaru(intr_src->src.ioapic_id, &sid);
}
if (is_dmar_unit_valid(dmar_unit, sid)) {
ir_table = (union dmar_ir_entry *)hpa2hva(dmar_unit->ir_table_addr);
ir_entry = ir_table + index;
ir_entry->bits.remap.present = 0x0UL;<commit_title>[PATCH] hv: validate input for dmar_fre... |
<vulnerable_code> scanline=(unsigned char *) AcquireQuantumMemory(iris_info.columns,
bytes_per_pixel*sizeof(*scanline));
if (scanline == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
for (z=0; z < (ssize_t) iris_info.depth; z++)
... |
<vulnerable_code> INTOUT();
ND_PRINT((ndo, " length"));
INTOUT();
temp = EXTRACT_32BITS(bp);
bp += sizeof(int32_t);
tok2str(ubik_lock_types, "type %d", temp);<commit_title>[PATCH] CVE-2017-13049/Rx: add a missing bounds check for Ubik<commit_description>One of the case blocks in ubik_print() didn't che... |
<vulnerable_code>const http = require('http')
const https = require('https')
const { URL } = require('url')
const dns = require('dns')
const ipAddress = require('ip-address')
const request = require('request')
const logger = require('../logger')
const FORBIDDEN_IP_ADDRESS = 'Forbidden IP address'
function isIPAddress... |
<vulnerable_code> @authorized
def get(self, path, **kwargs):
"""Get a file by path."""
if os.path.splitext(path)[1] == ".ipynb" or self.get_argument("download", None):
name = path.rsplit("/", 1)[-1]
self.set_attachment_header(name)<commit_title>[PATCH] Merge pull request f... |
<vulnerable_code> new_cursor_col += (*mb_ptr2len)(ptr + new_cursor_col);
else
++new_cursor_col;
vcol += lbr_chartabsize(ptr, ptr + new_cursor_col, (colnr_T)vcol);
}
vcol = last_vcol;<commit_title>[PATCH] patch 8.2.4436: crash with weird 'vartabstop' value<commit_description>Problem: Crash with weird '... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4435,
/**/<commit_title>[PATCH] patch 8.2.4436: crash with weird 'vartabstop' value<commit_description>Problem: Crash with weird 'vartabstop' value.
Solution: Check for running into the end of the line.<fixed_... |
<vulnerable_code> op_table_t * from_ot = so->so_this_dt;
int n_ordered = from_ot ? dk_set_length (from_ot->ot_oby_ots) : -1;
int n_in_order = 0;
for (dfe = dfe; dfe; dfe = dfe->dfe_next)
{
if (dfe == last_tb)
return 1;
sqlo_place_exp (so, from_ot->ot_work_dfe, arg_dfe);
}
else
sqlo_plac... |
<vulnerable_code> }
#endif /* GC_LINUX_THREADS */
void * calloc(size_t n, size_t lb)
{
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
/* libpthread allocated some memory that is only pointed to by */
/* mmapped thread stacks. Make sure it's not collectable. */<commit... |
<vulnerable_code> for(data in req.body){
if(req.body.hasOwnProperty(data)) {
file.write(data);
}
}
}<commit_title>[PATCH] fml<commit_description><fixed_code>
for(data in req.body){
if(req.body.hasOwnProperty(data)) {
file.write(data);
console.log(data);
}
... |
<vulnerable_code> query = query.slice(1);
}
const setValue = function(root, path, value) {
if (path.length > 1) {
const dir = path.shift();
if (typeof root[dir] === 'undefined') {<commit_title>[PATCH] BAP-21092: JavaScript Pr... |
<vulnerable_code> !W3W_AUTOSUGGEST_SETTINGS.enable_clip_to_bounding_box &&
!W3W_AUTOSUGGEST_SETTINGS.enable_clip_to_polygon
) {
console.log('inside')
billingCountry.on('change', function(e) {
$('#w3w-billing').closest('what3words-autosuggest').attr('clip_to_country', e.tar... |
<vulnerable_code> }
}
private void test(String userName, boolean canRead, boolean canWrite) throws Exception {
ModelControllerClient client = getClientForUser(userName);
<commit_title>[PATCH] [WFCORE-5511] Add a test case for a Maintainer smuggling a<commit_description><fixed_code>
}
... |
<vulnerable_code>
struct user_element {
struct snd_ctl_elem_info info;
void *elem_data; /* element data */
unsigned long elem_data_size; /* size of element data in bytes */
void *tlv_data; /* TLV data */
{
struct user_element *ue = kcontrol->private_data;
memcpy(&ucontrol->value, ue->elem_data, ue->elem_data_... |
<vulnerable_code> INIT_LIST_HEAD(&card->devices);
init_rwsem(&card->controls_rwsem);
rwlock_init(&card->ctl_files_rwlock);
INIT_LIST_HEAD(&card->controls);
INIT_LIST_HEAD(&card->ctl_files);
spin_lock_init(&card->files_lock);<commit_title>[PATCH] ALSA: control: Protect user controls against concurrent<commit_descri... |
<vulnerable_code> _.each(this._inputFields, function(field) {
if (
field === 'avatar' ||
field === 'email'
) {
return;
}<commit_title>[PATCH] Prevent duplicate set display name request<commit_description>Signed-off-by: Christopher Ng <chrng8@gmail.com><fixed_code>
_.each(this._inputField... |
<vulnerable_code> }
// Deserialize from the plaintext
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss << pt.get();
SaplingOutgoingPlaintext ret;
ss >> ret;
assert(ss.size() == 0);
return ret;
}
boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::decrypt(
}
// Deser... |
<vulnerable_code> inp.datepicker( "destroy" );
} );
} );<commit_title>[PATCH] Datepicker: Make sure text option are text, shorten HTML<commit_description><fixed_code>
inp.datepicker( "destroy" );
} );
QUnit.test( "Ticket #15284: escaping text parameters", function( assert ) {
assert.expect( 7 );
var done = assert... |
<vulnerable_code> inst.append.remove();
}
if ( appendText ) {
inst.append = $( "<span class='" + this._appendClass + "'>" + appendText + "</span>" );
input[ isRTL ? "before" : "after" ]( inst.append );
}
if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
butt... |
<vulnerable_code> }
mask=CloneImage(image,layer_info->mask.page.width,
layer_info->mask.page.height,MagickFalse,exception);
mask->matte=MagickFalse;
channel_image=mask;
}
offset=TellBlob(image);<commit_title>[PATCH] Added missing null check.<commit_description><fixed_code>
}
... |
<vulnerable_code> status=MagickFalse;
offset=(ssize_t) fseek(file,(ssize_t) offset,SEEK_SET);
length=WriteLSBLong(file,(unsigned int) length);
(void) fclose(file);
(void) CloseBlob(image);
image=DestroyImage(image);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/352<commit_descrip... |
<vulnerable_code>
R_API RBinJavaAttrInfo *r_bin_java_read_next_attr_from_buffer(ut8 *buffer, st64 sz, st64 buf_offset) {
RBinJavaAttrInfo *attr = NULL;
char *name = NULL;
ut64 offset = 0;
ut16 name_idx;
st64 nsz;
RBinJavaAttrMetas *type_info = NULL;
if (!buffer || ((int) sz) < 4 || buf_offset < 0) {
eprintf (... |
<vulnerable_code>
/******************************************************************************/
/* taken from vncauth.c */
void DEFAULT_CC
rfbEncryptBytes(char *bytes, char *passwd)
{
char key[24];
void *des;
}
/******************************************************************************/
/* taken from vn... |
<vulnerable_code>
for (c = 1; users[c] != NULL; c++)
{
if (strcasecmp(domains[0], domains[c]) != 0)
{
if (conf->conf_dolog)
{<commit_title>[PATCH] Skip null domains when checking multi-value From header<commit_description><fixed_code>
for (c = 1; users[c] != NULL; c++)
{
if (domains[0] != NULL... |
<vulnerable_code>app.set('views', __dirname + '/views');
app.set('view engine', 'pug');
app.use(express.urlencoded({extended: true}));
app.use(cookieParser(process.env.COOKIE_KEY || 'f76210bc2acc4f54af5754e15b0aab05'));
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.raw({<commit_title>[PATCH... |
<vulnerable_code> var query = url_parts.query;
var tudid = query.udid;
if (tudid) // If it's in the query, store it and redirect (so the user doesn't see the UDID being sent in the URL)
{
res.cookie('newudid', query.udid, { maxAge: 10 * 60 * 1000}); // Store for 10 minutes
res.re... |
<vulnerable_code> TrackWriter *tkw = gf_filter_pid_get_udta(pid);
if (tkw) {
gf_list_del_item(ctx->tracks, tkw);
gf_free(tkw);
}
//removing last pid<commit_title>[PATCH] Fixed #2583<commit_description><fixed_code>
TrackWriter *tkw = gf_filter_pid_get_udta(pid);
if (tkw) {
gf_list_del_item(ctx->track... |
<vulnerable_code>package com.liferay.taglib.ui;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.taglib.util.IncludeTag;
protected void setAttributes(HttpServletRequest request) {
request.setAttribute("liferay-ui:header:backLabel", _backLabel);
... |
<vulnerable_code> screen->columns=(size_t) GetDeviceCaps(hDC,HORZRES);
screen->rows=(size_t) GetDeviceCaps(hDC,VERTRES);
screen->storage_class=DirectClass;
status=SetImageExtent(screen,screen->columns,screen->rows,exception);
if (status == MagickFalse)
return(DestroyImageList(image)... |
<vulnerable_code>
// Weak verifier
const ifModifiedSince = Date.parse(ifModifiedSinceHeader);
const lastModified = Date.parse(lastModifiedHeader);
if (ifModifiedSince &&
lastModified &&
};
internals.fail = function (request, boom, c... |
<vulnerable_code>*
* Copyright (C) 2018 http://alvarotrigo.com/fullPage - A project by Alvaro Trigo
*/
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).fullpage=t()}(this,(function... |
<vulnerable_code>
for (var i = 0; i < numSlides; i++) {
var slide = $(SLIDE_SEL, sectionElem)[i];
appendTo(createElementFromHTML('<li><a href="#"><span class="fp-sr-only">' + getBulletLinkName(i, 'Slide', slide) + '</span><span></span></a></li>'), $('ul', nav)[0]);
} //centering it
... |
<vulnerable_code>*
* Copyright (C) 2018 http://alvarotrigo.com/fullPage - A project by Alvaro Trigo
*/
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).fullpage=t()}(this,(function... |
<vulnerable_code> link = section.anchor;
}
li += '<li><a href="#' + link + '"><span class="fp-sr-only">' + getBulletLinkName(section.index(), 'Section') + '</span><span></span></a>';
// Only add tooltip if needed (defined by user)
var tooltip = getOptions().navigationTooltip... |
<vulnerable_code>
for(var i=0; i< numSlides; i++){
var slide = utils.$(SLIDE_SEL, sectionElem)[i];
utils.appendTo(utils.createElementFromHTML('<li><a href="#"><span class="fp-sr-only">'+ getBulletLinkName(i, 'Slide', slide) +'</span><span></span></a></li>'), utils.$('ul', nav)[0] );
}
//cen... |
<vulnerable_code><commit_title>[PATCH] Implement K6 testing script for GET request<commit_description><fixed_code>
import http from "k6/http";
import { check, sleep } from "k6";
export let options = {
stages: [
{duration: "30s", target: 150},
{duration: "570s", target: 150},
]
};
// skew requests towards ... |
<vulnerable_code>const app = require('./index.js');
app.listen(3010, () => {<commit_title>[PATCH] Implement K6 testing script for GET request<commit_description><fixed_code>
const newRelic = require('newrelic');
const app = require('./index.js');
app.listen(3010, () => { |
<vulnerable_code> * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*
File: jp2image.cpp
Version: $Rev$
*/
// *****************************************************************************
#include "rcsid_int.hpp"
EXIV2_RCSID("@(#) $Id$")
return result;
}
vo... |
<vulnerable_code><commit_title>[PATCH] Fix #1011 fix_1011_jp2_readmetadata_loop<commit_description>(cherry picked from commit 1b917c3f7dd86336a9f6fda4456422c419dfe88c)
(cherry picked from commit 55af05397a7e3517f24c5fb503efb4bec90c66f0)<fixed_code>
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
class... |
<vulnerable_code> service['ismarker'] = '2'
service['servicename'] = ''
else:
service['servicename'] = item[1]
if item[0].flags & eServiceReference.isGroup:
gservices = []
service['isgroup'] = '1'
for gitem in gfulllist:
gservice = {}
gservice['servicereference'] =... |
<vulnerable_code>
static int handle_emulation_failure(struct kvm_vcpu *vcpu)
{
++vcpu->stat.insn_emulation_fail;
trace_kvm_emulate_insn_failed(vcpu);
vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
vcpu->run->internal.ndata = 0;
kvm_queue_exception(vc... |
<vulnerable_code>
if (add==NULL) add = "(null)";
addlen=strlen(add)+1; /* only compute once */
if (_buf_alloc(out, alloclen, (*outlen)+addlen)!=SASL_OK)
return SASL_NOMEM;
strncpy(*out + *outlen, add, addlen);
*outlen += addlen-1;
return SASL_OK;
}<commit_title>[PATCH] Fix _sasl_add_string<commit_des... |
<vulnerable_code> bot.say('Attempting to OP...')
bot.say('op ' + trigger.sender, 'ChanServ')
time.sleep(1)
if isusermode and not trigger.group(2):
bot.write(['MODE', trigger.sender, mode, trigger.nick])
elif isusermode and trigger.account in chanops:
... |
<vulnerable_code> */
package org.gradle.api.internal.artifacts.repositories;
import org.apache.http.protocol.HTTP;
import org.gradle.api.Action;
import org.gradle.api.Transformer;
import org.gradle.api.artifacts.repositories.AuthenticationContainer;<commit_title>[PATCH] Make checkstyle happy<commit_description><fixed_... |
<vulnerable_code>import org.gradle.api.artifacts.repositories.MavenArtifactRepository;
import org.gradle.api.artifacts.repositories.MavenRepositoryContentDescriptor;
import org.gradle.api.internal.FeaturePreviews;
import org.gradle.api.internal.artifacts.repositories.layout.ResolvedPattern;
import org.gradle.api.intern... |
<vulnerable_code>import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.SecureString;
import java.util.List;
/**
public SecureString getPassword() {
return password;
}
}<commit_title>[PATCH] Addressed comments and added integ tests<commit_description><fixed_code>
import org.... |
<vulnerable_code> throttles = super().get_throttles()
if self.action == "reset_password":
throttles.append(PasswordResetRequestThrottle())
return throttles
def get_serializer_class(self):<commit_title>[PATCH] Added missing permissions on API endpoints<commit_description>... |
<vulnerable_code>from django.contrib.auth import login
from drf_spectacular.utils import extend_schema
from rest_framework import response, status
from rest_framework.exceptions import AuthenticationFailed
from rest_framework_simplejwt import views as jwt_views
from rest_framework_simplejwt.exceptions import InvalidTo... |
<vulnerable_code>from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from modoboa.core import constants as core_constants, signals as core_signals
from modoboa.core.models import ObjectAccess, User
group.permissions.add(
Permission.ob... |
<vulnerable_code>"""Parameters viewsets."""
from drf_spectacular.utils import extend_schema, OpenApiParameter
from rest_framework import response, viewsets
from rest_framework.decorators import action
from modoboa.lib.throttle import GetThrottleViewsetMixin
from . import serializers
"""Parameter viewset."""
... |
<vulnerable_code> selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = $(selector === '#' ? [] : selector)
if (e) e.preventDefault()
<commit_title>[PATCH] Fix XSS in Alert, Carousel, Collapse, Dropdown and Modal<commit_description><fixed_code>
selector ... |
<vulnerable_code> // =================
var clickHandler = function (e) {
var href
var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
if (!$target.hasClass('carousel')) return
var options = $.exten... |
<vulnerable_code> var target = $trigger.attr('data-target')
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
return $(target)
}
<commit_title>[PATCH] Fix XSS in Alert, Carousel, Collapse, Dropdown and Modal<commit_description><fixed_code>
var target = $trigge... |
<vulnerable_code> selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}<commit_title>[PATCH] Fix XSS in Alert, Carousel, Collapse, Dropdown an... |
<vulnerable_code> $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
var option = $target.data('bs.modal') ?... |
<vulnerable_code>const plugins = require('../plugins');
const ratelimit = require('../middleware/ratelimit');
const Namespaces = {};
const Sockets = module.exports;
<commit_title>[PATCH] fix: prototype vulnerability in socket.io onMessage<commit_description><fixed_code>
const plugins = require('../plugins');
const ra... |
<vulnerable_code> filterset_class = filters.GitRepositoryFilterSet
@extend_schema(methods=["post"], request=serializers.GitRepositorySerializer)
@action(detail=True, methods=["post"])
def sync(self, request, pk):
"""
Enqueue pull git repository and refresh data.<commit_title>[PATCH] Fixe... |
<vulnerable_code> def test_run_git_sync_no_celery_worker(self, mock_get_worker_count):
"""Git sync cannot be triggered if Celery is not running."""
mock_get_worker_count.return_value = 0
self.add_permissions("extras.add_gitrepository")
self.add_permissions("extras.change_gitrepository... |
<vulnerable_code> this.states = new Statehood.Definitions(this.settings.state);
this.auth = new Auth(this);
this._router = new Call.Router(this.settings.router);
this._defaultRoutes();
this._corsPaths = {};
this.plugins = {}; // Registered plugin APIs by plugin name
this.app... |
<vulnerable_code>
// CORS
if (this.settings.cors) {
this.settings.cors = Hoek.applyToDefaults(Defaults.cors, this.settings.cors);
var cors = this.settings.cors;
this.connection._cors(this.method, this.path, this.plugin, cors);
cors._headers = cors.headers.concat(cors.additiona... |
<vulnerable_code> credentials: Joi.boolean(),
override: Joi.boolean().allow('merge')
})
.allow(null, false, true),
ext: Joi.object({
onPreAuth: Joi.array().items(internals.event).single(),
onPostAuth: Joi.array().items(internals.event).single(),<commit_title>[PATCH] Prep f... |
<vulnerable_code> var root = this.root; // Explicitly use the root reference (for plugin invocation)
var settings = Hoek.applyToDefaultsWithShallow(root._settings.connections, options || {}, ['listener', 'routes.bind']);
settings.routes.cors = Hoek.applyToDefaults(root._set... |
<vulnerable_code>
return parse_boolean(e);
}
int serialize_environment(FILE *f, char **environment) {
char **e;
STRV_FOREACH(e, environment) {
_cleanup_free_ char *ce;
ce = cescape(*e);
if (!ce)
return -ENOMEM;
... |
<vulnerable_code>
#include "alloc-util.h"
#include "conf-files.h"
#include "env-util.h"
#include "exec-util.h"
#include "fd-util.h"
#include "hashmap.h"
#include "macro.h"
#include "process-util.h"
#include "set.h"
#include "signal-util.h"
#include "stat-util.h"
return -errno;
}
r = ser... |
<vulnerable_code>#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
return buf;
}
void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) {
assert(f);
assert(name);
assert(t);
... |
<vulnerable_code>#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "special.h"
#include "stdio-util.h"
#include "string-table.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", automount_state_to_string(a->state));
unit_serialize_item(u, f, "re... |
<vulnerable_code>#include "mkdir.h"
#include "process-util.h"
#include "selinux-access.h"
#include "service.h"
#include "special.h"
#include "string-util.h"
int c, j;
c = sd_bus_track_count_name(t, n);
for (j = 0; j < c; j++) {
fputs(prefix, f);
... |
<vulnerable_code>#include "log.h"
#include "parse-util.h"
#include "path-util.h"
#include "stat-util.h"
#include "string-util.h"
#include "swap.h"
assert(f);
assert(fds);
unit_serialize_item(u, f, "state", device_state_to_string(d->state));
if (device_found_to_string_many(d->found, &s)... |
<vulnerable_code>#include "io-util.h"
#include "parse-util.h"
#include "random-util.h"
#include "socket-util.h"
#include "stdio-util.h"
#include "string-util.h"
copy0 = fdset_put_dup(fds, d->storage_socket[0]);
if (copy0 < 0)
return copy0;
copy1 ... |
<vulnerable_code>#include "log.h"
#include "macro.h"
#include "parse-util.h"
#include "set.h"
#include "special.h"
#include "stdio-util.h"
assert(j);
assert(f);
fprintf(f, "job-id=%u\n", j->id);
fprintf(f, "job-type=%s\n", job_type_to_string(j->type));
fprintf(f, "job-state=%s\n... |
<vulnerable_code>
r = manager_serialize(m, f, fds, switching_root);
if (r < 0)
return log_error_errno(r, "Failed to serialize state: %m");
if (fseeko(f, 0, SEEK_SET) == (off_t) -1)
return log_error_errno(errno, "Failed to rewind serialization fd: %m");<commit_tit... |
<vulnerable_code>#include "sd-messages.h"
#include "sd-path.h"
#include "alloc-util.h"
#include "all-units.h"
#include "audit-fd.h"
#include "boot-timestamps.h"
#include "bus-common-errors.h"
#include "ratelimit.h"
#include "rlimit-util.h"
#include "rm-rf.h"
#include "signal-util.h"
#include "socket-util.h"
#include "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.