text stringlengths 79 3.72M |
|---|
<vulnerable_code>};
#endif
/*****************************************************************************/
/**
* Parses the fv1_select configuration value to get the font to use,
int fd;
int b;
int i;
int index;
int datasize;
int file_size;
struct xrdp_font_char *f;
const char *file_pa... |
<vulnerable_code>
for (index = 0; index < len; index++)
{
font_item = self->font->font_items + wstr[index];
rv = rv + font_item->incby;
}
total_height = 0;
for (index = 0; index < len; index++)
{
font_item = font->font_items + wstr[index];... |
<vulnerable_code>/*------------------------------------------------------------------*/
/* Copy link-layer address from LLAO option to a word-aligned uip_lladdr_t */
static int
extract_lladdr_from_llao_aligned(uip_lladdr_t *dest) {
if(dest != NULL && nd6_opt_llao != NULL) {
memcpy(dest, &nd6_opt_llao[UIP_ND6_OPT_... |
<vulnerable_code>import qrcode
import qrcode.image.svg
from django.conf import settings
context['user_id'] = int(self.kwargs['user_id'])
return context
class DeviceCreateView(OtpRequiredMixin, FormView):
form_class = forms.DeviceForm
def get_success_url(self):
return reverse('wagtail_2... |
<vulnerable_code>from django.test import override_settings
from unittest.mock import patch
from django.contrib.auth import get_user_model
from django.urls import reverse
from django_otp import DEVICE_ID_SESSION_KEY
from django_otp.plugins.otp_totp.models import TOTPDevice
from wagtail_2fa.views import DeviceListView
... |
<vulnerable_code> ReportBadUDPPacketFromConnectionPeer( "DataPacket", "Failed to varint decode size of stats blob" );
return;
}
if ( pIn + cbStatsMsgIn > pPktEnd )
{
ReportBadUDPPacketFromConnectionPeer( "DataPacket", "stats message size doesn't make sense. Stats message size %d, packet size %d", cbStats... |
<vulnerable_code> event_auth.check_state_independent_auth_rules(event_store, bad_event)
)
def test_random_users_cannot_send_state_before_first_pl(self):
"""
Check that, before the first PL lands, the creator is the only user<commit_title>[PATCH] Tests for bad auth_events<... |
<vulnerable_code> else result[item] = true;
});
} else {
for(var attr in obj2){
if(!result[attr]){
result[attr] = clone(obj2[attr]);
} else if(typeof result[attr] == 'object' && typeof obj2[attr] == 'object'){<commit_title>[PATCH 1/3] fix: safety check added to attr on obj key iteration<commit_d... |
<vulnerable_code><commit_title>[PATCH] Add regression test for #960<commit_description>(cherry picked from commit a048325e18d5328fc00b80cd2f0bf70a8f35ad9b)<fixed_code>
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
class WebPImageGetHeaderOffset(metaclass=CaseMeta):
"""
Regression test for t... |
<vulnerable_code> bits_per_pixel=(size_t) ReadBlobByte(image);
number_colormaps=(size_t) ReadBlobByte(image);
map_length=(unsigned char) ReadBlobByte(image);
if (map_length >= 32)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
one=1;
map_length=one << map_length;<commit_titl... |
<vulnerable_code>
if (!media_url) {
GF_MPD_BaseURL *base = gf_list_get(rep->base_URLs, 0);
if (!base) return GF_BAD_PARAM;
media_url = base->URL;
}
url_to_solve = NULL;<commit_title>[PATCH] fix memleak in mpd resolve url (fixes #2689)<commit_description><fixed_code>
if (!media_url) {
GF_MPD_BaseURL *base =... |
<vulnerable_code> return True
# Disable password authentication for MFA
if userobj.mfa == UserObject.ENABLED_MFA:
return False
# Otherwise validate username password
return any(cherrypy.engine.publish('login', username, password))
class ApiCurrentUser(Controller):
@cherr... |
<vulnerable_code>from markupsafe import Markup
from wtforms.form import Form
SUBMIT_METHODS = {'POST', 'PUT', 'PATCH', 'DELETE'}
class _ProxyFormdata:
"""
Consider the form submitted if there is an active request and
the method is ``POST``, ``PUT``, ``PATCH``, or ``DELETE``.
"""
r... |
<vulnerable_code> action = StringField(validators=[validators.regexp('delete')])
number = IntegerField(validators=[validators.data_required()])
@property
def app(self):
return cherrypy.request.app
@cherrypy.tools.is_admin()
class AdminSessionPage(Controller):<commit_title>[PATCH] Improve ratel... |
<vulnerable_code>
@cherrypy.expose()
@cherrypy.tools.auth_mfa(on=False)
@cherrypy.tools.ratelimit()
def index(self, **kwargs):
"""
Called by auth_form to generate the /login/ page.<commit_title>[PATCH] Improve ratelimit implementation<commit_description><fixed_code>
@cherrypy.expose... |
<vulnerable_code>
class MfaPage(Controller):
@cherrypy.expose()
@cherrypy.tools.ratelimit()
def index(self, **kwargs):
form = MfaForm()
<commit_title>[PATCH] Improve ratelimit implementation<commit_description><fixed_code>
class MfaPage(Controller):
@cherrypy.expose()
@cherrypy.tools.rateli... |
<vulnerable_code>from rdiffweb.core.model import UserObject
from rdiffweb.tools.i18n import gettext_lazy as _
# Maximum number of password change attempt before logout
CHANGE_PASSWORD_MAX_ATTEMPT = 5
CHANGE_PASSWORD_ATTEMPTS = 'change_password_attempts'
class UserProfileForm(CherryForm):
action = HiddenField(def... |
<vulnerable_code> action = StringField(validators=[validators.regexp('delete')])
number = IntegerField(validators=[validators.data_required()])
@property
def app(self):
return cherrypy.request.app
class PagePrefSession(Controller):
@cherrypy.expose<commit_title>[PATCH] Improve ratelimit im... |
<vulnerable_code> }
def test_login_ratelimit(self):
for i in range(0, 6):
self.getPage('/api/')
self.assertStatus(429)<commit_title>[PATCH] Improve ratelimit implementation<commit_description><fixed_code>
}
def test_login_ratelimit(self):
# Given invalid credentials ... |
<vulnerable_code>
@author: Patrik Dufresne
"""
from parameterized import parameterized
import rdiffweb.test
from rdiffweb.core.model import DbSession, SessionObject, UserObject
self.assertInBody('HEADER-NAME')
class LoginPageRateLimitTest(rdiffweb.test.WebCase):
default_config = {
'rate-limit'... |
<vulnerable_code> self._set_password(self.PASSWORD, new_password, new_password)
self.assertInBody("Password must have between 8 and 128 characters.")
def test_change_password_too_many_attemps(self):
# When udating user's password with wrong current password 5 times
for _i in range(1,... |
<vulnerable_code> '--rate-limit',
metavar='LIMIT',
type=int,
default=30,
help='maximum number of requests per minute that can be made by an IP address for an unauthenticated connection. When this limit is reached, an HTTP 429 message is returned to the user. This security measure ... |
<vulnerable_code> 'tools.sessions.persistent': False, # auth_form should update this.
'tools.auth_form.timeout': cfg.session_persistent_timeout, # minutes
'tools.ratelimit.debug': cfg.debug,
'tools.ratelimit.delay': 60,
'tools.ratelimit.an... |
<vulnerable_code># -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
def __init__(self, **kwarg... |
<vulnerable_code> base
);
// sameHost :: (Url, Url) -> Boolean
const sameHost = (parent, child) => {
const p = new URL (parent);
const c = new URL (child);
return p.host === c.host || c.host.endsWith ('.' + p.host);
};
// overHeaders :: (Request, Array2 String String -> Array2 String String)
... |
<vulnerable_code> headers: {location: 'https://elsewhere.com/'},
request: fn.Request ({headers: {cookie: 'yum'}}) ('https://example.com') (fn.emptyStream)})))
(fn.Request ({headers: {}}) ('https://elsewhere.com/') (fn.empt... |
<vulnerable_code> #mock_ecdf.assert_called_once()
#mock_box.assert_called_once()
#mock_scatter.assert_called_once()
# we're writing to report.csv, and report.txt
self.assertEqual(mo... |
<vulnerable_code> proc = mp.Process(target=self.ecdf_plot)
proc.start()
proc.join()
difference, p_vals, worst_pair, worst_p = \
self._write_individual_results()<commit_title>[PATCH] analysis: write legend for graphs<commit_description><fixed_code>
proc = mp.Process(ta... |
<vulnerable_code>from w3lib.url import safe_url_string
from scrapy.http import HtmlResponse
from scrapy.utils.response import get_meta_refresh
from scrapy.exceptions import IgnoreRequest, NotConfigured
logger = logging.getLogger(__name__)
class BaseRedirectMiddleware:
enabled_setting = 'REDIRECT_ENABLED'
... |
<vulnerable_code>
from scrapy.downloadermiddlewares.cookies import CookiesMiddleware
from scrapy.downloadermiddlewares.defaultheaders import DefaultHeadersMiddleware
from scrapy.exceptions import NotConfigured
from scrapy.http import Response, Request
from scrapy.spiders import Spider
from scrapy.utils.python import to... |
<vulnerable_code> init_waitqueue_head(&fcc->flush_wait_queue);
init_llist_head(&fcc->issue_list);
SM_I(sbi)->fcc_info = fcc;
init_thread:
fcc->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi,
"f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev));
INIT_LIST_HEAD(&sm_info->sit_entry_set);
if (test_opt(sbi, FLUSH_... |
<vulnerable_code> char* p = (char*) boxBuf.pData_;
bool bWroteColor = false ;
while ( count < length || !bWroteColor ) {
enforce(sizeof(Jp2BoxHeader) <= length - count, Exiv2::kerCorruptedMetadata);
Jp2BoxHeader* pSubBox = (Jp2BoxHeader*) (p+count) ;... |
<vulnerable_code># -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
class Jp2ImageEncodeJp2HeaderOutOfBoundsRead(metaclass=CaseMeta):
"""
"""
url = "https://github.com/Exiv2/exiv2/security/advisories/GHSA-8949-hhfh-j7rj"
filename1 = path("$data_path/issue_ghsa_8949_hhfh_j7rj_poc.jp2")
... |
<vulnerable_code>
#include "dbusservice.h"
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusInterface>
#include "logger.h"
#include "loghandler.h"
#include <sys/capability.h>
namespace {
Logger logger("DBusService");
}
}
// Get the PID of the D-Bus message sender.
QDBusConnectionInterface... |
<vulnerable_code> ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
jpeg_pixels=(JSAMPLE *) GetVirtualMemoryBlob(memory_info);
/*
Convert JPEG pixels to pixel packets.
*/<commit_title>[PATCH] Zero pixel buffer<commit_description><fixed_code>
ThrowReaderException(ResourceLimit... |
<vulnerable_code>from app import apfell, links, use_ssl
from sanic import response
from jinja2 import Environment, PackageLoader
from sanic_jwt.decorators import scoped, inject_user
from app.routes.routes import respect_pivot
import urllib.parse
env = Environment(loader=PackageLoader('app', 'templates'))
template... |
<vulnerable_code> char *ssl_keyfile;
char *ssl_certfile;
int err;
if (csync_conn_usessl)
return 0;
(gnutls_transport_ptr_t)(long)conn_fd_out
);
err = gnutls_handshake(conn_tls_session);
switch(err) {
case GNUTLS_E_SUCCESS:
break;
case GNUTLS_E_WARNING_ALERT_RECEIVED:
alrt = gnutls_alert_get(conn_tls_... |
<vulnerable_code> return true;
}
static bool indication_handler(struct restund_msgctx *ctx, int proto,
void *sock, const struct sa *src,
return true;
}
if (sa_is_loopback(psa) || sa_is_any(psa) || sa_is_linklocal(psa))
err = EPERM;
else
err = udp_send(al->rel_us, psa, &data->v.data);
mb->end = m... |
<vulnerable_code> output = [b""]
counter = 1
while (self._algorithm.digest_size // 8) * len(output) < self._length:
h = hmac.HMAC(key_material, self._algorithm, backend=self._backend)
h.update(output[-1])
h.update(self._info)<commit_title>[PATCH] Fixes #3211 -... |
<vulnerable_code>
hkdf.verify(b"foo", u"bar")
@pytest.mark.requires_backend_interface(interface=HMACBackend)
class TestHKDFExpand(object):<commit_title>[PATCH] Fixes #3211 -- fixed hkdf's output with short length (#3215)<commit_description><fixed_code>
hkdf.verify(b"foo", u"bar")
def tes... |
<vulnerable_code> bitmapCache->settings = settings;
bitmapCache->update = ((freerdp*)settings->instance)->update;
bitmapCache->context = bitmapCache->update->context;
bitmapCache->maxCells = settings->BitmapCacheV2NumCells;
bitmapCache->cells = (BITMAP_V2_CELL*)calloc(bitmapCache->maxCells, sizeof(BITMAP_V2_CELL));... |
<vulnerable_code> "?" /* 0x41 - 0x46 */
};
static void rdp_read_flow_control_pdu(wStream* s, UINT16* type);
static void rdp_write_share_control_header(wStream* s, UINT16 length, UINT16 type,
UINT16 channel_id);
static void rdp_write_share_data_header(wStream* s, UINT16 length... |
<vulnerable_code> return FALSE;
WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results PDU");
Stream_Read_UINT32(s, rdp->autodetect->bandwidthMeasureTimeDelta); /* timeDelta (4 bytes) */
Stream_Read_UINT32(s, rdp->autodetect->bandwidthMeasureByteCount); /* byteCount (4 bytes) */
<commit_title>[PATCH 01/16] F... |
<vulnerable_code> return NULL;
}
static void update_read_synchronize(rdpUpdate* update, wStream* s)
{
WINPR_UNUSED(update);
Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */
/**
* The Synchronize Update is an artifact from the
* T.128 protocol... |
<vulnerable_code> {
if (!(bitmapData->flags & NO_BITMAP_COMPRESSION_HDR))
{
Stream_Read_UINT16(s,
bitmapData->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */
Stream_Read_UINT16(s,<commit_title>[PATCH 01/16] Fixed possible NULL dereference<commit_description><fixed_code>
{
if (... |
<vulnerable_code>static BOOL rdp_read_font_capability_set(wStream* s, UINT16 length, rdpSettings* settings)
{
WINPR_UNUSED(settings);
if (length > 4)
Stream_Seek_UINT16(s); /* fontSupportFlags (2 bytes) */
if (length > 6)
Stream_Seek_UINT16(s); /* pad2Octets (2 bytes) */
return TRUE;<commit_title>[PATCH 01/16... |
<vulnerable_code> Stream_Read_UINT16(s, bitmapData->height); /* height (2 bytes) */
Stream_Read_UINT32(s, new_len); /* length (4 bytes) */
if (Stream_GetRemainingLength(s) < new_len)
goto fail;
new_data = (BYTE*)realloc(bitmapData->data, new_len);<commit_title>[PATCH 01/16] Fixed possible NULL derefer... |
<vulnerable_code> Stream_Read_UINT16(s, iconInfo->cbBitsMask); /* cbBitsMask (2 bytes) */
Stream_Read_UINT16(s, iconInfo->cbBitsColor); /* cbBitsColor (2 bytes) */
if (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor)
return FALSE;
/* bitsMask */
newBitMask = (BYTE*)realloc(iconInfo-... |
<vulnerable_code>
while (offset < length)
{
holdp = Stream_Pointer(s);
if (!gcc_read_user_data_header(s, &type, &blockLength))
{
WLog_ERR(TAG, "gcc_read_server_data_blocks: gcc_read_user_data_header failed");
return FALSE;
}
switch (type)
{
case SC_CORE:
if (!gcc_read_server_core_data(s, mc... |
<vulnerable_code>};
#endif
static void rdp_read_capability_set_header(wStream* s, UINT16* length, UINT16* type)
{
Stream_Read_UINT16(s, *type); /* capabilitySetType */
Stream_Read_UINT16(s, *length); /* lengthCapability */
}
static void rdp_write_capability_set_header(wStream* s, UINT16 length, UINT16 type)
* @r... |
<vulnerable_code> "pduType %s not properly parsed, %" PRIdz
" bytes remaining unhandled. Skipping.",
pdu_type_to_str(pduType), diff);
if (!Stream_SafeSeek(s, pduLength))
return -1;
}
}<commit_title>[PATCH 01/16] Fixed possible NULL dereference<commit_description><f... |
<vulnerable_code> rest = Stream_GetRemainingLength(&sub);
if (rest > 0)
{
WLog_ERR(TAG,
"incorrect offset, type:0x%04" PRIX16 " actual:%" PRIuz " expected:%" PRIuz "",
type, length + rest, length);
}
numberCapabilities--;<commit_title>[PATCH 01/16] Fixed possible NULL dereference<co... |
<vulnerable_code> WLog_ERR(TAG,
"incorrect offset, type:0x%04" PRIX16 " actual:%" PRIuz " expected:%" PRIu16
"",
type, rest + length, length);
}
numberCapabilities--;<commit_title>[PATCH 01/16] Fixed possible NULL dereference<commit_description><fixed_code>
WLog_ERR(TAG,
... |
<vulnerable_code> {
while (Stream_GetRemainingLength(s) > 3)
{
size_t startheader, endheader, start, end, diff, headerdiff;
startheader = Stream_GetPosition(s);
return -1;
}
pduLength -= headerdiff;
rdp->settings->PduSource = pduSource;
rdp->inPackets++;
switch (pduType)
{
case PDU... |
<vulnerable_code> "?" /* 0x41 - 0x46 */
};
static BOOL rdp_read_flow_control_pdu(wStream* s, UINT16* type);
static void rdp_write_share_control_header(wStream* s, UINT16 length, UINT16 type,
UINT16 channel_id);
static void rdp_write_share_data_header(wStream* s, UINT16 length... |
<vulnerable_code>{
UINT16 channelId;
UINT16 pduType;
UINT16 pduLength;
UINT16 pduSource;
UINT16 length;
UINT16 numberCapabilities;
if (freerdp_shall_disconnect(rdp->instance))
return TRUE;
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &pduSource))
{
WLog_ERR(TAG, "rdp_read_share_control_head... |
<vulnerable_code> rdpRdp* rdp;
UINT16 length;
UINT16 pduType;
UINT16 pduLength;
UINT16 pduSource;
UINT16 channelId;
UINT16 securityFlags = 0;
if (channelId == MCS_GLOBAL_CHANNEL_ID)
{
if (!rdp_read_share_control_header(s, &pduLength, &pduType, &pduSource))
return -1;
client->settings->PduSource = pduSo... |
<vulnerable_code> Stream_Write_UINT16(s, 0); /* flagsHi (unused) */
}
BOOL rdp_read_share_control_header(wStream* s, UINT16* length, UINT16* type, UINT16* channel_id)
{
UINT16 len;
if (Stream_GetRemainingLength(s) < 2)
/* Share Control Header */
Stream_Read_UINT16(s, len); /* totalLength */
*length = len;
... |
<vulnerable_code>from typing import Optional
import requests
from flask import current_app
from _orchest.internals.two_phase_executor import TwoPhaseExecutor, TwoPhaseFunction
from _orchest.internals.utils import rmtree
FileExistsError:
NotADirectoryError:
"""
full_project_path... |
<vulnerable_code> }
//Alignment
if (Size_Complete%2 && !IsNotWordAligned)
{
Size_Complete++; //Always 2-byte aligned
Alignement_ExtraByte=1;<commit_title>[PATCH] x B1101, AVI: fix crash with some invalid streams<commit_description><fixed_code>
}
//Alignment
if (Size_Complete... |
<vulnerable_code>void File_Riff::Data_Parse()
{
//Alignement specific
Element_Size-=Alignement_ExtraByte;
DATA_BEGIN
LIST(AIFC)<commit_title>[PATCH] x B1101, AVI: fix crash with some invalid streams<commit_description><fixed_code>
void File_Riff::Data_Parse()
{
//Alignement specific
if (Alignem... |
<vulnerable_code> event_id, allow_none=True, allow_rejected=True
)
if event:
await self._event_auth_handler.assert_host_in_room(event.room_id, origin)
events = await filter_events_for_server(
self._storage_controllers, origin, [event]
)
... |
<vulnerable_code> goto cleanup;
}
fd = CreateFileW(utf16_filename, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (fd == INVALID_HANDLE_VALUE) {
status = MMDB_FILE_OPEN_ERROR;
goto cleanup;<commit_title>[PATCH] Run uncrustify<c... |
<vulnerable_code> "country", "iso_code", NULL);
if (ok(entry_data.has_data, "found data for country{iso_code}")) {
char *string = mmdb_strndup(entry_data.utf8_string, entry_data.data_size);
if (!string) {
ok(0, "mmdb_strndup() call failed");
exit(1);<commit_ti... |
<vulnerable_code>
const char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data)
{
const char *string = mmdb_strndup(entry_data.utf8_string, entry_data.data_size);
if (NULL == string) {
BAIL_OUT("mmdb_strndup failed");
}<commit_title>[PATCH] Run uncrustify<commit_description><fixed_code>
const ... |
<vulnerable_code> MMDB_entry_data_list_s *entry_data_list)
{
MMDB_entry_data_list_s *description = entry_data_list =
entry_data_list->next;
cmp_ok(description->entry_data.type, "==", MMDB_DATA_TYPE_MAP,
"'description' key's value is a map");
cmp_ok... |
<vulnerable_code> if (err) {
ERROR(midi, "%s: couldn't enqueue request: %d\n",
midi->out_ep->name, err);
free_ep_req(midi->out_ep, req);
return err;
}
}<commit_title>[PATCH] USB: gadget: f_midi: fixing a possible double-free in f_midi<commit_description>It looks like there is a possibility of a dou... |
<vulnerable_code> for domain in federation_domain_whitelist:
self.federation_domain_whitelist[domain] = True
ip_range_blacklist = config.get(
"ip_range_blacklist", []
)
# Attempt to create an IPSet from the given ranges
try:
self.ip_ra... |
<vulnerable_code> String skinFolder = getSkinFolder();
String resourcePath = skinFolder + resource;
// Prevent inclusion of templates from other directories
Path normalizedResource = Paths.get(resourcePath).normalize();
// Protect against directory attacks.
if (!normalize... |
<vulnerable_code>import java.lang.reflect.Type;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collections;
: null;
}
private Template getClassloaderTemplate(String suffixPath, String templateName)
{
... |
<vulnerable_code> int fsize = p->maxstacksize; /* frame size */
int nfixparams = p->numparams;
int i;
ci->func -= delta; /* restore 'func' (if vararg) */
for (i = 0; i < narg1; i++) /* move down function and arguments */
setobjs2s(L, ci->func + i, func + i);
checkstackGC(L,... |
<vulnerable_code>
std::size_t MemIOCallback::write(const void *Buffer, std::size_t Size)
{
if (dataBufferMemorySize < dataBufferPos + Size) {
//We need more memory!
dataBuffer = static_cast<binary *>(realloc(static_cast<void *>(dataBuffer), dataBufferPos + Size));
std::uint32_t MemIOCallback::write(IOCallbac... |
<vulnerable_code>
protected UploadPackageResultDto performUploadPackage(MultipartFile pluginPackageFile, File localFilePath) {
String pluginPackageFileName = pluginPackageFile.getName();
if (!localFilePath.exists()) {
if (localFilePath.mkdirs()) {
log.info("Create directo... |
<vulnerable_code>import weakref
from sentry_sdk._types import MYPY
from sentry_sdk.consts import OP, SENSITIVE_DATA_SUBSTITUTE
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.scope import add_global_event_processor
from sentry_sdk.serializer import add_global_repr_processor
from sentry_sdk.tra... |
<vulnerable_code>import sentry_sdk
from sentry_sdk._compat import PY2, PY33, PY37, implements_str, text_type, urlparse
from sentry_sdk._types import MYPY
if MYPY:
from types import FrameType, TracebackType
},
)
if MYPY:
from typing import TypeVar<commit_title>[PATCH] Annotate cookies with... |
<vulnerable_code>
/* remove capability of path traversal */
/* discoverd by David Byrne of X-Force Red */
if (szof > 1) {
return 1;
}<commit_title>[PATCH] Update help.c<commit_description>added missing parts of the pr, sorry about that<fixed_code>
/* remove capability of path traversal */
... |
<vulnerable_code>var ArgumentError = require('rest-facade').ArgumentError;
var utils = require('./utils');
var Auth0RestClient = function(resourceUrl, options, provider) {
if (resourceUrl === null || resourceUrl === undefined) {
throw new ArgumentError('Must provide options');
}
this.options = options;
t... |
<vulnerable_code> * @memberOf module:errors
*/
errors.sanitizeErrorRequestData = function(error) {
if (!error.response || !error.response.request || !error.response.request._data) {
return error;
}
Object.keys(error.response.request._data).forEach(function(key) {
if (key.toLowerCase().match('password|s... |
<vulnerable_code> });
});
it('should catch error when provider.getAccessToken throws an error', function(done) {
var providerMock = {
getAccessToken: function() {<commit_title>[PATCH] sanitize auth headers on errors<commit_description><fixed_code>
});
});
it('should sanitize error when access... |
<vulnerable_code>
describe('Errors', function() {
describe('sanitizeErrorRequestData', function() {
describe('when passed in error is missing request data', function() {
var error = { response: { request: {} } };
var sanitizedError = errors.sanitizeErrorRequestData(error);
expect(sanitizedDat... |
<vulnerable_code> // Get key node
const keypath = arg.shift().split('.')
let key = keypath.shift()
let node = result
while(keypath.length)
{
node[key] = node[key] || {}
node = node[key]
key = keypath.shift()
}
// Get value
let val = true
if(arg.length)
if(val.length === 1) val = v... |
<vulnerable_code>const result = linuxCmdline(cmdline)
deepStrictEqual(result, expected)<commit_title>[PATCH] [fix] Don't pollute prototype<commit_description><fixed_code>
const result = linuxCmdline(cmdline)
deepStrictEqual(result, expected)
// Don't pollute prototype
const result2 = linuxCmdline('__proto__.pollute... |
<vulnerable_code> goto done;
else if (!read_image(grr, &gfc, gfi, read_flags)) {
Gif_RemoveImage(gfs, gfs->nimages - 1);
goto done;
}
<commit_title>[PATCH] Fix use-after-free problems reported in #114.<commit_description><fixed_code>
goto done;
else if (!read_ima... |
<vulnerable_code>Package.describe({
name: 'faisalman:ua-parser-js',
version: '0.7.28',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'<commit_title>[PATCH] Securing the 0.7.x version (issue #536)<commit_descript... |
<vulnerable_code> /////////////
var LIBVERSION = '0.7.28',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',<commit_title>[PATCH] Securing the 0.7.x version (issue #536)<commit_description><fixed_code>
/////////////
var LIBVERSION = '0.7.30',
EMPTY ... |
<vulnerable_code> (void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Copying JDAT chunk data to color_blob.");
if (length != 0)
{
(void) WriteBlob(color_image,length,chunk);
chunk=(unsigned char *) RelinquishMagickMemory(chunk);<commit_title>[PATCH] ... |
<vulnerable_code> 'ipython==8.10.0',
'jinja2==3.1.2',
'kombu==5.2.4',
'marshmallow==2.16.3',
'marshmallow-sqlalchemy==0.15.0',
'pyotp==2.8.0',
'questionary==1.10.0',
'requests==2.28.2',<commit_title>[PATCH 01/15] Updated marshmallow version<commit_descripti... |
<vulnerable_code> get_jwt, get_jwt_identity, jwt_required
)
from flask_socketio import SocketIO
from marshmallow_sqlalchemy import ModelSchema
from vantage6.common import logger_name
"""
return field in request.args.getlist('include')
def dump(self, page: Page, schema: ModelSchema) -> dict:
... |
<vulnerable_code>import base64
from marshmallow import fields
from marshmallow_sqlalchemy import ModelSchema
from flask import url_for
from vantage6.server import db
log = logging.getLogger(logger_name(__name__))
class HATEOASModelSchema(ModelSchema):
"""
This class is used to convert foreign-key fields to ... |
<vulnerable_code> List of nodes that are part of this organization
users : list[User]
List of users that are part of this organization
created_tasks : list[Task]
List of tasks that are created by this organization
roles : list[Role]
runs = relationship("Run", back_populates="orga... |
<vulnerable_code> collaboration = relationship("Collaboration", back_populates="tasks")
parent = relationship("Task", remote_side="Task.id", backref="children")
runs = relationship("Run", back_populates="task")
init_org = relationship("Organization", back_populates="created_tasks")
init_user = relati... |
<vulnerable_code> get_jwt, get_jwt_identity, jwt_required
)
from flask_socketio import SocketIO
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
from vantage6.common import logger_name
from vantage6.server import db
from vantage6.server.permission import PermissionManager
from vantage6.server.resource.pagin... |
<vulnerable_code> )
collaboration.save()
return collaboration_schema.dump(collaboration).data, HTTPStatus.OK
class Collaboration(CollaborationBase):
return {'msg': 'You lack the permission to do that!'}, \
HTTPStatus.UNAUTHORIZED
return collaboratio... |
<vulnerable_code> model = db.Run
node = fields.Function(
func=lambda obj: RunNodeSchema().dump(obj.node, many=False).data
)
ports = fields.Function(
func=lambda obj: RunPortSchema().dump(obj.ports, many=True).data
)
# but that is not possible because of the 'result' field i... |
<vulnerable_code>
# Return the node information to the user. Manually return the api_key
# to the user as the hashed key is not returned
node_json = node_schema.dump(node).data
node_json['api_key'] = api_key
return node_json, HTTPStatus.CREATED # 201
return {'ms... |
<vulnerable_code> )
organization.save()
return org_schema.dump(organization, many=False).data, \
HTTPStatus.CREATED
accepted = auth_org == req_org
if accepted:
return org_schema.dump(req_org, many=False).data, \
HTTPStatus.OK
... |
<vulnerable_code> )
port.save()
return port_schema.dump(port, many=False).data, HTTPStatus.CREATED
@with_node
def delete(self):
# serialize
s = port_schema
return s.dump(port, many=False).data, HTTPStatus.OK
class VPNAddress(ServicesResources):<commit_title>[P... |
<vulnerable_code> s = result_inc_schema if request.args.get('include') == 'task' \
else result_schema
return s.dump(result, many=False).data, HTTPStatus.OK
@with_node
def patch(self, id):
result.status = data.get("status", result.status)
result.save()
return... |
<vulnerable_code> rules=rules, organization_id=organization_id)
role.save()
return role_schema.dump(role, many=False).data, HTTPStatus.CREATED
class Role(RoleBase):
return {"msg": "You do not have permission to view this."},\
HTTPStatus.UNAUT... |
<vulnerable_code> if not rule:
return {'msg': f'Rule id={id} not found!'}, HTTPStatus.NOT_FOUND
return rule_schema.dump(rule, many=False).data, HTTPStatus.OK<commit_title>[PATCH 01/15] Updated marshmallow version<commit_description><fixed_code>
if not rule:
return {'msg':... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.