text stringlengths 79 3.72M |
|---|
<vulnerable_code>def tags(request):#view showing a listing of available tags - plain list
#1) Get parameters. This normally belongs to form cleaning.
sortby = request.GET.get('sort', 'used')
try:
page = int(request.GET.get('page', '1'))
except ValueError:
page = 1
else:
ord... |
<vulnerable_code>
@login_required
@permission_required("admin.add_domain")
def remove_permission(request):
domid = request.GET.get("domid", None)
daid = request.GET.get("daid", None)<commit_title>[PATCH] Force DELETE method for remove permission view.<commit_description>Avoids CSRF issue.<fixed_code>
@login_re... |
<vulnerable_code> // TODO: remove when upgrading to HTMLClener 2.23
private HTMLFilter controlFilter;
@Inject
private Execution execution;
this.listFilter,
this.fontFilter,
this.attributeFilter,
this.linkFilter));
return configuration;
}
<comm... |
<vulnerable_code><commit_title>[PATCH] XCOMMONS-1680: Filter Html attributes in restricted mode<commit_description><fixed_code>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under... |
<vulnerable_code>import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.context.internal.DefaultExecution;
import org.xwiki.test.annotation.ComponentList;
import org.xwiki.test.junit5.mockito.ComponentTest;
import org.xwiki.xml.internal.html... |
<vulnerable_code>import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.context.internal.DefaultExecution;
import org.xwiki.test.annotation.ComponentList;
import org.xwiki.test.junit5.mockito.ComponentTest;
import org.xwiki.xml.html.HTMLCleaner;
im... |
<vulnerable_code>import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.test.annotation.ComponentList;
import org.xwiki.test.junit5.mockito.ComponentTest;
import org.xwiki.test.junit5.mockito.InjectMockComponents;
import org.xwiki.xml.internal.htm... |
<vulnerable_code> if action_on_existing == "fail":
existing_key = set(session.scalars(select(Variable.key).where(Variable.key.in_(var_json))))
if existing_key:
raise SystemExit(f"Failed. These keys: {list(sorted(existing_key))} already exists.")
for k, v in var_json.items():
... |
<vulnerable_code>void*
_TIFFmalloc(tmsize_t s)
{
return (malloc((size_t) s));
}
<commit_title>[PATCH] * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does<commit_description><fixed_code>
void*
_TIFFmalloc(tmsize_t s)
{
if (s == 0)
return ((void *) NULL);
return (malloc((size_t) s));
}
|
<vulnerable_code>tdata_t
_TIFFmalloc(tsize_t s)
{
return (malloc((size_t) s));
}
<commit_title>[PATCH] * libtiff/tif_{unix,vms,win32}.c (_TIFFmalloc): ANSI C does<commit_description><fixed_code>
tdata_t
_TIFFmalloc(tsize_t s)
{
if (s == 0)
return ((void *) NULL);
return (malloc((size_t) s));
... |
<vulnerable_code> /* 11 */ {"(,) joe@joe.com", "joe.com"},
/* 12 */ {"\"( bob@bob.com)\" joe@joe.com", "joe.com"},
/* 12 */ {"From: Davide D'Marco <user@blah.com>", "blah.com"},
{NULL, NULL},
};
u_char dbuf[256];<commit_title>[PATCH] Fix multiple addresses in From vulnerability<commit_description><fixed_code... |
<vulnerable_code> strncpy(dfc->mctx_fromdomain, domain, sizeof dfc->mctx_fromdomain - 1);
ostatus = opendmarc_policy_store_from_domain(cc->cctx_dmarc,
from->hdr_value);
if (ostatus != DMARC_PARSE_OKAY)
{
if (conf->conf_dolog)<commit_title>[PATCH] Fix multiple addresse... |
<vulnerable_code> */
package com.aerospike.client;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.List;
}
public static byte[] serialize(Object val) {
if (DisableSerializer) {
throw new AerospikeException("Objec... |
<vulnerable_code> */
package com.aerospike.client.command;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
return null;
}
if (Value.DisableDeserializer) {
throw new AerospikeException.Seria... |
<vulnerable_code> */
package com.aerospike.client.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.nio.ByteBuffer;
import java.util.AbstractMap;
import java.util.ArrayList;
break;
case ParticleType.JBLOB:
if (Value.DisableDeserializer) {
... |
<vulnerable_code> int n=0;
FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, NULL);
/*
rfbLog("rfbProcessFileTransferReadBuffer(%dlen)\n", length);
*/
if (length>0) {
buffer=malloc((uint64_t)length+1);
if (buffer!=NULL) {
if ((n = rfbReadExact(cl, (char *)buffer, length)... |
<vulnerable_code>
from PIL import Image
repro_ss2 = ('images/fli_oob/06r/06r00.fli',
'images/fli_oob/06r/others/06r01.fli',
'images/fli_oob/06r/others/06r02.fli',
'images/fli_oob/06r/others/06r03.fli',
'images/fli_oob/06r/others/06r04.fli'
)
repro_lc = ('images/fli_... |
<vulnerable_code> }
if (!rc) {
rc = rpmpluginsCallFsmFilePrepare(plugins, NULL, dn, dn, mode, op);
}
/* Run fsm file post hook for all plugins */
}
if (!rc) {
rc = rpmpluginsCallFsmFilePrepare(plugins, fi,
path, dest,
st->st_mode, action);
}
<commit_title>[PATCH] Pass file d... |
<vulnerable_code>}
rpmRC rpmpluginsCallFsmFilePrepare(rpmPlugins plugins, rpmfi fi,
const char *path, const char *dest,
mode_t file_mode, rpmFsmOp op)
{
plugin_fsm_file_prepare_func hookFunc;
for (i = 0; i < plugins->count; i++) {
rpmPlugin plugin = plugins->plugins[i];
RPMPLUGINS_SET_HOOK_FUNC... |
<vulnerable_code>}
static rpmRC fapolicyd_fsm_file_prepare(rpmPlugin plugin, rpmfi fi,
const char *path, const char *dest,
mode_t file_mode, rpmFsmOp op)
{
/* not ready */<commit_title>[PATCH] Pass file descriptor to file prepare plug... |
<vulnerable_code> * but fails gracefully if the file system doesn't support it or the
* verity feature flag isn't enabled in the file system (ext4).
*/
static rpmRC fsverity_fsm_file_prepare(rpmPlugin plugin, rpmfi fi,
const char *path, const char *dest,
mode_t file_mode, rpmFsmOp op)
{
size... |
<vulnerable_code> return (memcmp(fsig, &zero_hdr, sizeof(zero_hdr)) == 0);
}
static rpmRC ima_fsm_file_prepare(rpmPlugin plugin, rpmfi fi,
const char *path,
const char *dest,
mode_t file_mode, rpmFsmOp op)
fsig = rp... |
<vulnerable_code> return rc;
}
static rpmRC selinux_fsm_file_prepare(rpmPlugin plugin, rpmfi fi,
const char *path, const char *dest,
mode_t file_mode, rpmFsmOp op)
{
if (sehandle && !XFA_SKIPPING(action)) {
char *scon = NULL;
if (selabel_lookup_raw(sehandle, &scon, dest, file_mode) == 0) {
... |
<vulnerable_code> help="Set the base name of the desktop entry for this "
"application. Used to set the app_id under Wayland. See "
"https://doc.qt.io/qt-5/qguiapplication.html#desktopFileName-prop")
parser.add_argument('--json-args', help=argp... |
<vulnerable_code>(Mainly commandline flag parsing)
"""
import pytest
from qutebrowser import qutebrowser
# pylint: disable=no-member
assert args.debug
assert not args.temp_basedir<commit_title>[PATCH] CVE-2021-41146: Add --untrusted-args to avoid argument<commit_description><fixed_code>
(Mainl... |
<vulnerable_code> int sock;
struct sockaddr_un addr;
addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, sockFile);
sock = socket(AF_UNIX, SOCK_STREAM, 0);<commit_title>[PATCH] libvncclient: bail out if unix socket name would overflow<commit_description>Closes #291<fixed_code>
int sock;
struct sockaddr_un ad... |
<vulnerable_code> /*
Layer name.
*/
length=(MagickSizeType) ReadBlobByte(image);
combined_length+=length+1;
if (length > 0)
(void) ReadBlob(image,(size_t) length++,layer_info[i].name);<commit_title>[PATCH] Fix improper cast that coul... |
<vulnerable_code>
UNREDACTED_CONTENT_DELETED = "FI.MAU.MSC2815_UNREDACTED_CONTENT_DELETED"
class CodeMessageException(RuntimeError):
"""An exception with integer code and message string attributes.<commit_title>[PATCH] Define an error code<commit_description><fixed_code>
UNREDACTED_CONTENT_DELETED = "FI.... |
<vulnerable_code> "object value separator ',' expected",
"invalid string sequence",
"expected comment",
};
const char *json_tokener_error_desc(enum json_tokener_error jerr)
tok->char_offset = 0;
tok->err = json_tokener_success;
while (PEEK_CHAR(c, tok)) {
redo_char:<commit_title>[PATCH] Patch to address... |
<vulnerable_code>#include <stddef.h>
#include <limits.h>
#include "linkhash.h"
void lh_abort(const char *msg, ...)
return (k1 == k2);
}
unsigned long lh_char_hash(const void *k)
{
unsigned int h = 0;
const char* data = (const char*)k;
while( *data!=0 ) h = h*129 + (unsigned int)(*data++) + LH_PRIME;
return h... |
<vulnerable_code><commit_title>[PATCH] Patch to address the following issues:<commit_description>* CVE-2013-6371: hash collision denial of service
* CVE-2013-6370: buffer overflow if size_t is larger than int<fixed_code>
/*
* random_seed.c
*
* Copyright (c) 2013 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metap... |
<vulnerable_code> && context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
#if ENABLED (JERRY_ES2015)
if (context_p->next_scanner_info_p->source_p == context_p->source_p)
{
JERRY_ASSERT (context_p->next_scanner_info_p->type == SCANNER_TYPE_ERR_REDECLARED);
parser_raise_error (context_p... |
<vulnerable_code> result = re.match(
r'^https?://maker\.ifttt\.com/use/'
r'(?P<webhook_id>[A-Z0-9_-]+)'
r'/?(?P<events>([A-Z0-9_-]+/?)+)?'
r'/?(?P<params>\?.+)?$', url, re.I)
if result:<commit_title>[PATCH] slight bulletproofing to IFTTT regex handling<com... |
<vulnerable_code> if (shell.endsWith("zsh")) {
result = result.replace(/^=/gu, "\\=").replace(/(\[|\]|\{|\})/g, "\\$1");
} else {
result = result.replace(/=(~)$/g, "=\\$1");
}
return result;<commit_title>[PATCH] Escape `=xxx:~` for Bash-like shells<commit_description><fixed_code>
if (shell.endsWith("z... |
<vulnerable_code>import edu.emory.mathcs.backport.java.util.Collections;
import io.onedev.commons.launcher.loader.ImplementationRegistry;
import io.onedev.commons.utils.ClassUtils;
import io.onedev.server.OneDev;
import io.onedev.server.GeneralException;
import io.onedev.server.util.BeanUtils;
import io.onedev.server.w... |
<vulnerable_code>
new = object.__new__
get_complex = re.compile(r'^\(?(?P<re>[\+\-]?\d*\.?\d*(e[\+\-]?\d+)?)??'
r'(?P<im>[\+\-]?\d*\.?\d*(e[\+\-]?\d+)?j)?\)?$')
if BACKEND == 'sage':
from sage.libs.mpmath.ext_main import Context as BaseMPContext<commit_title>[PATCH 1/2] Fix ReDOS vulnerab... |
<vulnerable_code> assert mpmathify('(1.2e-10 - 3.4e5j)') == mpc('1.2e-10', '-3.4e5')
assert mpmathify('1j') == mpc(1j)
def test_compatibility():
try:
import numpy as np<commit_title>[PATCH 1/2] Fix ReDOS vulnerability<commit_description>Fixes #548, with the workaround suggested by @yetingli.<fixed_c... |
<vulnerable_code>def test_issue548():
try:
# This expression is invalid, but may trigger the ReDOS vulnerability
# in the regular expression.
mpmathify('(' + '1' * 5000 + '!j')
except:
return<commit_title>[PATCH 1/2] Fix ReDOS vulnerability<commit_description>Fixes #548, with the... |
<vulnerable_code> RARLABS,
GNAUNRAR,
UNZIP,
P7ZIP,
TAR
} ComicBookDecompressType;
typedef struct _ComicsDocumentClass ComicsDocumentClass;
/* 7zip */
{NULL , "%s l -- %s" , "%s x -y %s -o%s", FALSE, OFFSET_7Z},
/* tar */
{"%s -xOf" , "%s -tf %s" , NULL ... |
<vulnerable_code>#endif
p = start;
if (reg->dist_min > 0) {
if (ONIGENC_IS_SINGLEBYTE(reg->enc)) {
p += reg->dist_min;
}
else {
UChar *q = p + reg->dist_min;
if (q >= end) return 0; /* fail */
while (p < q) p += enclen(reg->enc, p);
}
}
}
if (p && p < range) {
if... |
<vulnerable_code> port = p->port;
if (port) {
struct br_mdb_entry e;
e.ifindex = port->dev->ifindex;
e.state = p->state;
if (p->addr.proto == htons(ETH_P_IP))
break;
bpm = nlmsg_data(nlh);
bpm->ifindex = dev->ifindex;
if (br_mdb_fill_info(skb, cb, dev) < 0)
goto out;
retur... |
<vulnerable_code>#include <string.h>
#endif // TF_LITE_STATIC_MEMORY
int TfLiteIntArrayGetSizeInBytes(int size) {
static TfLiteIntArray dummy;
int computed_size = sizeof(dummy) + sizeof(dummy.data[0]) * size;
#if defined(_MSC_VER)
// Context for why this is needed is in http://b/189926408#comment21
computed_... |
<vulnerable_code> Expression* visitUnreachable(Unreachable* curr) {
return builder.makeUnreachable();
}
Expression* visitPush(Push* curr) {
return builder.makePush(curr->value);
}
Expression* visitPop(Pop* curr) {
return builder.makePop(curr->type);
}
};
Copier copier(wasm,... |
<vulnerable_code> fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
}
exif_thumbnail_build(ImageInfo TSRMLS_CC);
}
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFE... |
<vulnerable_code> {
if (request.getMethod().equals("GET"))
{
DoGetResumable(request, response);
}
}
else
// Resumable.js uses HTTP Get to recognize whether a specific part/chunk of
// a file was uploaded already. This method handle... |
<vulnerable_code>import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang.StringUtils;
import org.dspace.core.ConfigurationManager;
/**
private String tempDir = null;
/** Original request */
private HttpS... |
<vulnerable_code> if (commands == null || commands.isEmpty()) {
throw new IllegalArgumentException("List of commands may not be null or empty");
}
ensureNoNullCharacters(commands);
this.environment = new TreeMap<String, String>(environment);
this.command = new ArrayList<String>(co... |
<vulnerable_code> )
path = os.path.join(directory, name)
generated_file = workspace.get_path(path)
path = os.path(generated_file)
try:
with open(path, "w+", encoding="utf-8") as f:<commit_title>[PATCH] fixed typo<commit_description><fixed_code>
)
path = os.path.join(directory, name)
... |
<vulnerable_code>}
/* }}} */
static zval *spl_array_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
spl_handler_ArrayObject.get_properties = spl_array_get_properties;
spl... |
<vulnerable_code> with self.assertRaises(ValueError):
p.port
def test_attributes_without_netloc(self):
# This example is straight from RFC 3261. It looks like it
# should allow the username, hostname, and port to be filled<commit_title>[PATCH] gh-... |
<vulnerable_code> allow_fragments = bool(allow_fragments)
netloc = query = fragment = ''
i = url.find(':')
if i > 0:
for c in url[:i]:
if c not in scheme_chars:
break<commit_title>[PATCH] gh-99418: Prevent urllib.parse.urlparse from accepting<commit_description><fixed_... |
<vulnerable_code>public class AdminLoginController extends HttpServlet {
private static final long serialVersionUID = 1L;
AdminDao adminDao = new AdminDaoImpl();
SHA256 sha = new SHA256();
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//... |
<vulnerable_code>package com.bijay.onlinevotingsystem.controller;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SHA256 {
public String getSHA(String password) {
try {
// Static getInstance method is called with hashing SHA
Messa... |
<vulnerable_code>public class VoterLoginController extends HttpServlet {
private static final long serialVersionUID = 1L;
VoterDao voterDao = new VoterDaoImpl();
SHA256 sha = new SHA256();
private String host;
private String port;
otp = r.nextInt(max - min) + min;
String userName = request.getParameter("unam... |
<vulnerable_code>import java.util.ArrayList;
import java.util.List;
import com.bijay.onlinevotingsystem.dto.Admin;
import com.bijay.onlinevotingsystem.util.DbUtil;
@Override
public boolean loginValidate(String userName, String password) {
String sql = "select * from admin_table where admin_name=? and password=?"... |
<vulnerable_code>import java.util.List;
import java.sql.Date;
import com.bijay.onlinevotingsystem.dto.Voter;
import com.bijay.onlinevotingsystem.util.DbUtil;
@Override
public boolean loginValidate(String userName, String password, String email) {
String sql = "select * from voter_table where voter_name=? and pas... |
<vulnerable_code>
public interface SecureXml {
default Document parseXmlSafely(final int contentLength, final Reader reader) throws WebdavException {
if (contentLength == 0) {
return null;
}
if (reader == null) {
// No content?
return null;
}
... |
<vulnerable_code>
public class TestSecureXmlTypes {
@Rule
public MockitoRule mockitoRule = MockitoJUnit.rule();
@Mock
private HttpServletRequest request;
@Mock
private HttpServletResponse response;
@Mock(answer = Answers.CALLS_REAL_METHODS)
private WebdavNsIntf webdavNsIntf;
@Moc... |
<vulnerable_code>/* Generated routines, do not edit. */
/* Generated sourcedate 2020-10-11 11:34:27-07:00 */
/* BEGIN FILE */
<commit_title>[PATCH] modified: configure modified: configure.ac now<commit_description><fixed_code>
/* Generated routines, do not edit. */
/* Generated sourcedate 2020-10-17 11:30:22... |
<vulnerable_code> memcpy(stream,header,12);
count=ReadBlob(image,length-12,stream+12);
if (count != (ssize_t) (length-12))
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
webp_status=WebPGetFeatures(stream,length,features);
if (webp_status == VP8_STATUS_OK)
{
}
stat... |
<vulnerable_code># Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from typing import List, Optional
from uuid import UUID
tenants = get_allowed_tenants()
if token["iss"] not in tenants:
logging.error("issuer not from allowed tenant: %s - %s", token['iss'], tenants)
ret... |
<vulnerable_code>!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var n=[],i=... |
<vulnerable_code>!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var n=[],i=... |
<vulnerable_code>!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var n=[],i=... |
<vulnerable_code> }
if (inst.text() == 'volume_off'){
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/1');
confLH.new_message_sound_admin_enabled = 1;
inst.text('volume_up');
} else {
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/0');
confLH.new_message_soun... |
<vulnerable_code>var lhcError={log:function(t,e,i,s,a){var n;(n={}).message=t||"",n.location=location&&location.href?location.href:"",n.message+="\n"+window.navigator.userAgent,n.file=e||"",n.line=i||"",n.column=a||"",n.stack=s?JSON.stringify(s):"",n.stack=n.stack.replace(/(\r\n|\n|\r)/gm,"");var o=new XMLHttpRequest;o... |
<vulnerable_code>(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[1],{482:function(t,e,r){var n=r(493),o=function(){return!this}();function i(t,e){this.name="AuthTokenExpiredError",this.message=t,this.expiry=e,Error.captureStackTrace&&!o?Error.captureStackTrace(this,arguments.callee):this.stac... |
<vulnerable_code>(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[2],{513:function(e,t,a){"use strict";a.r(t);var n=a(6),l=a.n(n),c=a(7),o=a.n(c),s=a(9),i=a.n(s),r=a(10),m=a.n(r),d=a(3),u=a.n(d),p=a(11),h=a.n(p),b=a(12),f=a.n(b),g=a(0),E=a.n(g),v=(a(20),a(25)),N=function(e){function t(e){var a... |
<vulnerable_code>(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[3],{512:function(e,t,a){"use strict";a.r(t);var n=a(6),s=a.n(n),l=a(7),i=a.n(l),r=a(9),o=a.n(r),c=a(10),m=a.n(c),d=a(3),u=a.n(d),h=a(11),p=a.n(h),b=a(12),f=a.n(b),g=a(0),v=a.n(g),E=a(20),w=a.n(E),N=a(25),y=function(e){function t... |
<vulnerable_code>(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[4],{510:function(t,e,a){"use strict";a.r(e);var i,n=a(12),s=a.n(n),r=a(6),o=a.n(r),p=a(7),h=a.n(p),c=a(9),d=a.n(c),l=a(10),g=a.n(l),f=a(3),u=a.n(f),m=a(11),w=a.n(m),_=a(0),b=a.n(_),v=a(24),I=a(140),y=(a(199),a(25)),C=a(5),E=a(2)... |
<vulnerable_code>(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[5],{511:function(t,e,a){"use strict";a.r(e);var i,s=a(6),o=a.n(s),n=a(7),p=a.n(n),r=a(9),c=a.n(r),d=a(10),h=a.n(d),g=a(3),l=a.n(g),m=a(11),v=a.n(m),w=a(12),u=a.n(w),I=a(0),_=a.n(I),f=a(24),b=a(5),E=a(2),y=a(86),N=Object(f.b)((fu... |
<vulnerable_code>(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[6],{514:function(e,t,i){"use strict";i.r(t);var a=i(141),s=i.n(a),n=i(198),r=i.n(n),o=i(6),c=i.n(o),l=i(7),u=i.n(l),d=i(9),h=i.n(d),p=i(10),m=i.n(p),f=i(3),g=i.n(f),v=i(11),w=i.n(v),b=i(12),y=i.n(b),R=i(0),k=i.n(R);function U(){... |
<vulnerable_code>(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[7],{481:function(t,e,a){"use strict";a.r(e),a.d(e,"nodeJSChat",(function(){return d}));var n=a(6),i=a.n(n),s=a(7),c=a.n(s),h=a(2),o=a(5),d=new(function(){function t(){var e=this;i()(this,t),this.socket=null,h.a.eventEmitter.addL... |
<vulnerable_code>!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LHCReactAPP=e():t.LHCReactAPP=e()}(window,(function(){return function(t){function e(e){for(var n,i,a=e[0],o=e[1],s=0,c=[];s<a.length;s+... |
<vulnerable_code><commit_title>[PATCH] CSRF minor fixes (#1726)<commit_description>* CSRF minor fixes<fixed_code>
|
<vulnerable_code>
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.doc.XWikiAttachment;
import com.xpn.xwiki.plugin.fileupload.FileUploadPlugin;
/**
xWikiAttachment.setFilename(part.getSubmittedFileName());
xWikiAttachment.setContent(part.getInputStream());
xWikiAttachment.se... |
<vulnerable_code>package org.xwiki.store.script;
import java.io.IOException;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.ServletException;
import javax.servlet.http.Part;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.xwiki.component.anno... |
<vulnerable_code>import com.xpn.xwiki.XWiki;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.doc.XWikiAttachment;
import com.xpn.xwiki.plugin.fileupload.FileUploadPlugin;
import com.xpn.xwiki.web.Utils;
import com.xpn.xwiki.web.XWikiRequest;
import static org.junit.jupiter.api.Assertions.assertEquals;
import s... |
<vulnerable_code><commit_title>[PATCH] XWIKI-20180:<commit_description><fixed_code>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public ... |
<vulnerable_code> assert not is_safe_path('etc/lists/../../../../../../var/ossec/api/scripts/wazuh-apid.py', relative=True)
assert not is_safe_path('../etc/rules/rule.xml', relative=False)
assert not is_safe_path('../etc/rules/rule.xml')
assert not is_safe_path('..\\etc\\rules\\rule.xml')
assert not ... |
<vulnerable_code> True if path is correct. False otherwise.
"""
# Protect path
forbidden_paths = ["../", "..\\"]
if any([forbidden_path in path for forbidden_path in forbidden_paths]):
return False
<commit_title>[PATCH] Add new forbidden paths to API active-response command<commit_descrip... |
<vulnerable_code> BUG_ON(path[depth].p_hdr == NULL);
/* try to insert block into found extent and return */
if (ex && (flag != EXT4_GET_BLOCKS_PRE_IO)
&& ext4_can_extents_be_merged(inode, ex, newext)) {
ext_debug("append [%d]%d block to %d:[%d]%d (from %llu)\n",
ext4_ext_is_uninitialized(newext),
merge:
/*... |
<vulnerable_code>#include <linux/uio.h>
#include <linux/bio.h>
#include <linux/workqueue.h>
#include "ext4_jbd2.h"
#include "xattr.h"
ext4_truncate(inode);
}
static int ext4_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void... |
<vulnerable_code> ei->i_reserved_quota = 0;
#endif
INIT_LIST_HEAD(&ei->i_completed_io_list);
ei->cur_aio_dio = NULL;
ei->i_sync_tid = 0;
ei->i_datasync_tid = 0;
if (test_opt(sb, NOLOAD))
seq_puts(seq, ",norecovery");
ext4_show_quota_options(seq, sb);
return 0;
Opt_stripe, Opt_delalloc, Opt_nodelalloc,
Opt_... |
<vulnerable_code> if (flags & MSG_CMSG_COMPAT)
return -EINVAL;
if (COMPAT_USE_64BIT_TIME)
return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
flags | MSG_CMSG_COMPAT,
(struct timespec *) timeout);
if (timeout == NULL)
return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen... |
<vulnerable_code># include <bsd/stdlib.h>
#endif
#if !defined(HAVE_GETRANDOM) && !defined(HAVE_SYSCALL_GETRANDOM) \
&& !defined(HAVE_ARC4RANDOM_BUF) && !defined(HAVE_ARC4RANDOM) \
static int
writeRandomBytes_RtlGenRandom(void * target, size_t count) {
int success = 0; /* full count bytes written? */
const HM... |
<vulnerable_code>version = '4.1'
# The full version, including alpha/beta/rc tags.
release = '4.1.7'
# -- General configuration ---------------------------------------------------
<commit_title>[PATCH 2/8] fix: all methods in ResponseTrait should be protected<commit_description>Public methods can be accessible via HT... |
<vulnerable_code> bcopy((uint8_t *) native, bits, bits_size);
#else
uECC_vli_bytesToNative(native, bits, bits_size);
#endif
if (bits_size * 8 <= (unsigned)curve->num_n_bits) {
return;
}
uECC_word_t tmp[uECC_MAX_WORDS];
uECC_word_t s[uECC_MAX_WORDS];
uECC_word_t *k2[2] = {tmp, s};
... |
<vulnerable_code>
const ONENTRY = Symbol('onEntry')
const CHECKFS = Symbol('checkFs')
const MAKEFS = Symbol('makeFs')
const FILE = Symbol('file')
const DIRECTORY = Symbol('directory')
entry.resume()
}
// check if a thing is there, and if so, try to clobber it
[CHECKFS] (entry) {
this[PEND]()
fs.lst... |
<vulnerable_code>
t.end()
})<commit_title>[PATCH] unpack: only reuse file fs entries if nlink = 1<commit_description>This matches behavior in bsdtar to prevent overwriting a hardlink with
contents from a File archive entry.<fixed_code>
t.end()
})
t.test('do not reuse hardlinks, only nlink=1 files', t => {
const... |
<vulnerable_code> }
}
if (update) {
if (len > 0) {
pop_n(len*2+1);
genop_2(s, OP_HASHADD, cursp(), len);
push();
}
return -1; /* variable length */
}
if (update) return -1;
return len;
}
<commit_title>[PATCH] codegen.c: no `OP_HASHADD` required when `val` is f... |
<vulnerable_code>
# Loop the registration process until successful registration
attempt = 0
while True and attempt < MAX_NUM_OF_ATTEMPTS_TO_SUBSCRIBE:
registration_cmd = get_registration_cmd()
attempt_msg = ""
if attempt > 0:
attempt_msg = "Attempt %d of %d: " % (attempt... |
<vulnerable_code>
import pytest
from convert2rhel import redhatrelease, utils
from convert2rhel.logger import setup_logger_handler
from convert2rhel.systeminfo import system_info
from convert2rhel.toolopts import tool_opts
setup_logger_handler(log_name="convert2rhel", log_dir=str(tmpdir))
@pytest.fixture()
def p... |
<vulnerable_code>
from collections import namedtuple
import pytest
from convert2rhel import unit_tests # Imports unit_tests/__init__.py
from convert2rhel import pkghandler, subscription, utils
from convert2rhel.systeminfo import system_info
from convert2rhel.toolopts import tool_opts
from convert2rhel.unit_tests imp... |
<vulnerable_code> @unit_tests.mock(logger, "LOG_DIR", unit_tests.TMP_DIR)
@unit_tests.mock(utils, "run_subprocess", RunSubprocessMocked(("rpmva\n", 0)))
def test_generate_rpm_va(self):
# Check that rpm -Va is executed (default) and stored into the specific file.
system_info.generate_rpm_va()
... |
<vulnerable_code># You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import getpass
import os
import sys
import unittest
assert is_rpm_based_os() in (True, False)
def test_get_package_name_from_rpm(monkeypatch):
monke... |
<vulnerable_code> return output, return_code
def run_cmd_in_pty(cmd, print_cmd=True, print_output=True, columns=120):
"""Similar to run_subprocess(), but the command is executed in a pseudo-terminal.
The pseudo-terminal can be useful when a command prints out a different output with or without an active t... |
<vulnerable_code><commit_title>[PATCH] Do not put the subscription-manager password onto the command<commit_description><fixed_code>
from multiprocessing import Pool
import psutil
def watchdog():
while True:
for process in psutil.process_iter():
# For some reason the psutil catches subscripti... |
<vulnerable_code> env.str("RHSM_KEY"),
)
) as c2r:
c2r.expect_exact(" ... activation key detected: ")
c2r.expect_exact("Organization: ")
c2r.sendline()
assert c2r.expect_exact(["Organization", "Registering the system"]) == 0<commit_title>[PATCH] Do not put the subs... |
<vulnerable_code> assert.deepEqual(joint.util.setByPath({ object: {}}, 'object/1', 'property'), { object: { '1': 'property' }}, 'define property');
});
['__proto__/polluted', 'constructor/prototype/polluted'].forEach(function(path) {
QUnit.test('setting "' + path + '" does not po... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.