code
stringlengths 12
2.05k
| label
int64 0
1
| programming_language
stringclasses 9
values | cwe_id
stringlengths 6
14
| cwe_name
stringlengths 5
103
⌀ | description
stringlengths 36
1.23k
⌀ | url
stringlengths 36
48
⌀ | label_name
stringclasses 2
values |
---|---|---|---|---|---|---|---|
public function search(){
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria;
$username = Yii::app()->user->name;
$criteria->addCondition("uploadedBy='$username' OR private=0 OR private=null");
$criteria->addCondition("associationType != 'theme'");
return $this->searchBase($criteria);
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
function reset_stats() {
// global $db;
// reset the counters
// $db->sql ('UPDATE '.$db->prefix.'banner SET impressions=0 WHERE 1');
banner::resetImpressions();
// $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1');
banner::resetClicks();
// let the user know we did stuff.
flash('message', gt("Banner statistics reset."));
expHistory::back();
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
foreach ($value as $val) {
$this->allowedUrls[$key][] = $val;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
function delete_vendor() {
global $db;
if (!empty($this->params['id'])){
$db->delete('vendor', 'id =' .$this->params['id']);
}
expHistory::back();
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function testPopBeforeSmtpBad()
{
//Start a fake POP server on a different port
//so we don't inadvertently connect to the previous instance
$pid = shell_exec('nohup ./runfakepopserver.sh 1101 >/dev/null 2>/dev/null & printf "%u" $!');
$this->pids[] = $pid;
sleep(2);
//Test a known-bad login
$this->assertFalse(
POP3::popBeforeSmtp('localhost', 1101, 10, 'user', 'xxx', $this->Mail->SMTPDebug),
'POP before SMTP should have failed'
);
shell_exec('kill -TERM '.escapeshellarg($pid));
sleep(2);
} | 0 | PHP | CWE-20 | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. | https://cwe.mitre.org/data/definitions/20.html | vulnerable |
public static function extract ($var, $m) {
foreach ($var as $k2 => $v2) {
if ($k2 != '0') {
$va[] = [$k2 => $m[$v2]];
}elseif($k2 == ''){
$va = ['default'];
}else{
$va = array($k2) ;
}
}
return $va;
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function showall() {
expHistory::set('viewable', $this->params);
$limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10;
if (!empty($this->params['view']) && ($this->params['view'] == 'showall_accordion' || $this->params['view'] == 'showall_tabbed')) {
$limit = '0';
}
$order = isset($this->config['order']) ? $this->config['order'] : "rank";
$page = new expPaginator(array(
'model'=>'photo',
'where'=>$this->aggregateWhereClause(),
'limit'=>$limit,
'order'=>$order,
'categorize'=>empty($this->config['usecategories']) ? false : $this->config['usecategories'],
'uncat'=>!empty($this->config['uncat']) ? $this->config['uncat'] : gt('Not Categorized'),
'groups'=>!isset($this->params['gallery']) ? array() : array($this->params['gallery']),
'grouplimit'=>!empty($this->params['view']) && $this->params['view'] == 'showall_galleries' ? 1 : null,
'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),
'controller'=>$this->baseclassname,
'action'=>$this->params['action'],
'src'=>$this->loc->src,
'columns'=>array(
gt('Title')=>'title'
),
));
assign_to_template(array(
'page'=>$page,
'params'=>$this->params,
));
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public static function data($vars){
$file = GX_MOD.'/'.$vars.'/index.php';
$handle = fopen($file, 'r');
$data = fread($handle, filesize($file));
fclose($handle);
preg_match('/\* Name: (.*)\n\*/U', $data, $matches);
$d['name'] = $matches[1];
preg_match('/\* Desc: (.*)\n\*/U', $data, $matches);
$d['desc'] = $matches[1];
preg_match('/\* Version: (.*)\n\*/U', $data, $matches);
$d['version'] = $matches[1];
preg_match('/\* Build: (.*)\n\*/U', $data, $matches);
$d['build'] = $matches[1];
preg_match('/\* Developer: (.*)\n\*/U', $data, $matches);
$d['developer'] = $matches[1];
preg_match('/\* URI: (.*)\n\*/U', $data, $matches);
$d['url'] = $matches[1];
preg_match('/\* License: (.*)\n\*/U', $data, $matches);
$d['license'] = $matches[1];
preg_match('/\* Icon: (.*)\n\*/U', $data, $matches);
$d['icon'] = $matches[1];
return $d;
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
static function lookupByUsername($username) {
if (strpos($username, '@') !== false)
$user = static::lookup(array('user__emails__address'=>$username));
else
$user = static::lookup(array('username'=>$username));
return $user;
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
foreach ($days as $event) {
if (empty($event->eventdate->date) || ($viewrange == 'upcoming' && $event->eventdate->date < time()))
break;
if (empty($event->eventstart))
$event->eventstart = $event->eventdate->date;
$extitem[] = $event;
} | 1 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | safe |
foreach ($day as $extevent) {
$event_cache = new stdClass();
$event_cache->feed = $extgcalurl;
$event_cache->event_id = $extevent->event_id;
$event_cache->title = $extevent->title;
$event_cache->body = $extevent->body;
$event_cache->eventdate = $extevent->eventdate->date;
if (isset($extevent->dateFinished) && $extevent->dateFinished != -68400)
$event_cache->dateFinished = $extevent->dateFinished;
if (isset($extevent->eventstart))
$event_cache->eventstart = $extevent->eventstart;
if (isset($extevent->eventend))
$event_cache->eventend = $extevent->eventend;
if (isset($extevent->is_allday))
$event_cache->is_allday = $extevent->is_allday;
$found = false;
if ($extevent->eventdate->date < $start) // prevent duplicating events crossing month boundaries
$found = $db->selectObject('event_cache','feed="'.$extgcalurl.'" AND event_id="'.$event_cache->event_id.'" AND eventdate='.$event_cache->eventdate);
if (!$found)
$db->insertObject($event_cache,'event_cache');
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
private function mail_passthru($to, $subject, $body, $header, $params) {
if ( ini_get('safe_mode') || !($this->UseSendmailOptions) ) {
$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header);
} else {
$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, $params);
}
return $rt;
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
public function addError($severity, $message) {
$this->errors[] = array($severity, $message);
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function meta_box_subject() {
?>
<h4><?php _e( 'Subject', 'supportflow' ); ?></h4>
<input
type="text"
id="subject"
name="post_title"
class="sf_autosave"
placeholder="<?php _e( 'What is your conversation about?', 'supportflow' ); ?>"
value="<?php echo esc_attr( get_the_title() ); ?>"
autocomplete="off"
/>
<p class="description">
<?php _e( 'Please describe what this ticket is about in several words', 'supportflow' ) ?>
</p>
<?php
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public static function page($vars) {
switch (SMART_URL) {
case true:
# code...
$url = Site::$url."/".self::slug($vars).GX_URL_PREFIX;
break;
default:
# code...
$url = Site::$url."/index.php?page={$vars}";
break;
}
return $url;
} | 1 | PHP | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function delete_recurring() {
$item = $this->event->find('first', 'id=' . $this->params['id']);
if ($item->is_recurring == 1) { // need to give user options
expHistory::set('editable', $this->params);
assign_to_template(array(
'checked_date' => $this->params['date_id'],
'event' => $item,
));
} else { // Process a regular delete
$item->delete();
}
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function __construct()
{
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function confirm()
{
$task = $this->getTask();
$subtask = $this->getSubtask();
$this->response->html($this->template->render('subtask/remove', array(
'subtask' => $subtask,
'task' => $task,
)));
} | 0 | PHP | CWE-200 | Exposure of Sensitive Information to an Unauthorized Actor | The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. | https://cwe.mitre.org/data/definitions/200.html | vulnerable |
public function updateFile(Attachment $attachment, $requestData)
{
$attachment->name = $requestData['name'];
if (isset($requestData['link']) && trim($requestData['link']) !== '') {
$attachment->path = $requestData['link'];
if (!$attachment->external) {
$this->deleteFileInStorage($attachment);
$attachment->external = true;
}
}
$attachment->save();
return $attachment;
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
$passwd = generate_password(PASSWORD_LENGTH);
if (change_user_password($name, $passwd)) {
$email = safe_field("email", 'txp_users', "name = '".doSlash($name)."'");
if (send_new_password($passwd, $email, $name)) {
$changed[] = $name;
$msg = 'author_updated';
} else {
return author_list(array(gTxt('could_not_mail').' '.txpspecialchars($name), E_ERROR));
}
}
}
break;
}
if ($changed) {
return author_list(gTxt($msg, array('{name}' => txpspecialchars(join(', ', $changed)))));
}
author_list($msg);
} | 0 | PHP | CWE-521 | Weak Password Requirements | The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts. | https://cwe.mitre.org/data/definitions/521.html | vulnerable |
private function rotate($volume, $src, $srcImgInfo, $quality) {
if (! function_exists('exif_read_data')) {
return false;
}
$degree = 0;
$exif = exif_read_data($src);
if ($exif && !empty($exif['Orientation'])) {
switch($exif['Orientation']) {
case 8:
$degree = 270;
break;
case 3:
$degree = 180;
break;
case 6:
$degree = 90;
break;
}
}
$opts = array(
'degree' => $degree,
'jpgQuality' => $quality
);
return $volume->imageUtil('rotate', $src, $opts);
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function downloadAttachment($key='download', $id)
{
if ($key != null && $key != 'download') {
$user = $this->checkAuthUser($key);
} else {
if (!$this->Auth->user()) {
throw new UnauthorizedException(__('You are not authorized. Please send the Authorization header with your auth key along with an Accept header for application/xml.'));
}
$user = $this->checkAuthUser($this->Auth->user('authkey'));
}
// if the user is authorised to use the api key then user will be populated with the user's account
// in addition we also set a flag indicating whether the user is a site admin or not.
if (!$user) {
throw new UnauthorizedException(__('This authentication key is not authorized to be used for exports. Contact your administrator.'));
}
$this->Attribute->id = $id;
if (!$this->Attribute->exists()) {
throw new NotFoundException(__('Invalid attribute or no authorisation to view it.'));
}
$this->Attribute->read(null, $id);
if (!$user['User']['siteAdmin'] &&
$user['User']['org_id'] != $this->Attribute->data['Event']['org_id'] &&
(
$this->Attribute->data['Event']['distribution'] == 0 ||
$this->Attribute->data['Attribute']['distribution'] == 0
)) {
throw new NotFoundException(__('Invalid attribute or no authorisation to view it.'));
}
$this->__downloadAttachment($this->Attribute->data['Attribute']);
} | 0 | PHP | NVD-CWE-noinfo | null | null | null | vulnerable |
$query->whereExists(function ($permissionQuery) use (&$tableDetails, $action) {
/** @var Builder $permissionQuery */
$permissionQuery->select(['role_id'])->from('joint_permissions')
->whereColumn('joint_permissions.entity_id', '=', $tableDetails['tableName'] . '.' . $tableDetails['entityIdColumn'])
->whereColumn('joint_permissions.entity_type', '=', $tableDetails['tableName'] . '.' . $tableDetails['entityTypeColumn'])
->where('action', '=', $action)
->whereIn('role_id', $this->getCurrentUserRoles())
->where(function (QueryBuilder $query) {
$this->addJointHasPermissionCheck($query, $this->currentUser()->id);
});
});
}); | 0 | PHP | CWE-863 | Incorrect Authorization | The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions. | https://cwe.mitre.org/data/definitions/863.html | vulnerable |
public static function getHelpVersionId($version) {
global $db;
return $db->selectValue('help_version', 'id', 'version="'.$db->escapeString($version).'"');
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
private function sendString ($string) {
$bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
return $bytes_sent;
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
public function tokenizeHTML($html, $config, $context) {
$html = $this->normalize($html, $config, $context);
// attempt to armor stray angled brackets that cannot possibly
// form tags and thus are probably being used as emoticons
if ($config->get('Core.AggressivelyFixLt')) {
$char = '[^a-z!\/]';
$comment = "/<!--(.*?)(-->|\z)/is";
$html = preg_replace_callback($comment, array($this, 'callbackArmorCommentEntities'), $html);
do {
$old = $html;
$html = preg_replace("/<($char)/i", '<\\1', $html);
} while ($html !== $old);
$html = preg_replace_callback($comment, array($this, 'callbackUndoCommentSubst'), $html); // fix comments
}
// preprocess html, essential for UTF-8
$html = $this->wrapHTML($html, $config, $context);
$doc = new DOMDocument();
$doc->encoding = 'UTF-8'; // theoretically, the above has this covered
set_error_handler(array($this, 'muteErrorHandler'));
$doc->loadHTML($html);
restore_error_handler();
$tokens = array();
$this->tokenizeDOM(
$doc->getElementsByTagName('html')->item(0)-> // <html>
getElementsByTagName('body')->item(0)-> // <body>
getElementsByTagName('div')->item(0) // <div>
, $tokens);
return $tokens;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
protected function getFullPath($path, $base) {
$separator = $this->separator;
$systemroot = $this->systemRoot;
if ($base[0] === $separator && strpos($base, 0, strlen($systemroot)) !== $systemroot) {
$base = $systemroot . substr($base, 1);
}
// 'Here'
if ($path === '' || $path === '.' . $separator) return $base;
$sepquoted = preg_quote($separator, '#');
if (substr($path, 0, 3) === '..' . $separator) {
$path = $base . $separator . $path;
}
// normalize `/../`
$normreg = '#('.$sepquoted.')[^'.$sepquoted.']+'.$sepquoted.'\.\.'.$sepquoted.'#'; // '#(/)[^\/]+/\.\./#'
while(preg_match($normreg, $path)) {
$path = preg_replace($normreg, '$1', $path, 1);
}
// Absolute path
if ($path[0] === $separator || strpos($path, $systemroot) === 0) {
return $path;
}
$preg_separator = '#' . $sepquoted . '#';
// Relative path from 'Here'
if (substr($path, 0, 2) === '.' . $separator || $path[0] !== '.') {
$arrn = preg_split($preg_separator, $path, -1, PREG_SPLIT_NO_EMPTY);
if ($arrn[0] !== '.') {
array_unshift($arrn, '.');
}
$arrn[0] = $base;
return join($separator, $arrn);
}
return $path;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$count += $db->dropTable($basename);
}
flash('message', gt('Deleted').' '.$count.' '.gt('unused tables').'.');
expHistory::back();
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
function delete_vendor() {
global $db;
if (!empty($this->params['id'])){
$db->delete('vendor', 'id =' .$this->params['id']);
}
expHistory::back();
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
$files[$key]->save();
}
// eDebug($files,true);
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$layout[$position] = array($elem => $initLayout[$position][$elem]) + $layout[$position]; // unshift key-value pair
$changed = true;
}
// remove obsolete widgets
$arrayDiff =
array_diff(array_keys($layoutWidgets), array_keys($initLayoutWidgets));
foreach($arrayDiff as $elem){
if(in_array ($elem, array_keys ($layout[$position]))) {
unset($layout[$position][$elem]);
$changed = true;
} else if($position === 'center' && in_array ($elem, array_keys ($layout['hidden']))) {
unset($layout['hidden'][$elem]);
$changed = true;
}
}
// ensure that widget properties are the same as those in the default layout
foreach($layout[$position] as $name=>$arr){
if (in_array ($name, array_keys ($initLayout[$position])) &&
$initLayout[$position][$name]['title'] !== $arr['title']) {
$layout[$position][$name]['title'] = $initLayout[$position][$name]['title'];
$changed = true;
}
}
if ($position === 'center') {
foreach($layout['hidden'] as $name=>$arr){
if (in_array ($name, array_keys ($initLayout[$position])) &&
$initLayout[$position][$name]['title'] !== $arr['title']) {
$layout['hidden'][$name]['title'] = $initLayout[$position][$name]['title'];
$changed = true;
}
}
}
if($changed){
$this->layout = json_encode($layout);
$this->update(array('layout'));
}
} | 0 | PHP | CWE-20 | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. | https://cwe.mitre.org/data/definitions/20.html | vulnerable |
public function add($def, $config) {
return false;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function remove()
{
$project = $this->getProject();
$this->checkCSRFParam();
$column_id = $this->request->getIntegerParam('column_id');
if ($this->columnModel->remove($column_id)) {
$this->flash->success(t('Column removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this column.'));
}
$this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])));
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
private function initProfileFieldFilter(ProfileField $profileField, $sortOrder = 1000)
{
$profileFieldType = $profileField->getFieldType();
if (!$profileFieldType) {
return;
}
$definition = $profileFieldType->getFieldFormDefinition();
$fieldType = isset($definition[$profileField->internal_name]['type']) ? $definition[$profileField->internal_name]['type'] : null;
$filterData = [
'title' => Yii::t($profileField->getTranslationCategory(), $profileField->title),
'type' => $fieldType,
'sortOrder' => $sortOrder,
];
switch ($fieldType) {
case 'text':
$filterData['type'] = 'widget';
$filterData['widget'] = PeopleFilterPicker::class;
$filterData['widgetOptions'] = [
'itemKey' => $profileField->internal_name
];
break;
case 'dropdownlist':
$filterData['options'] = array_merge(['' => Yii::t('UserModule.base', 'Any')], $definition[$profileField->internal_name]['items']);
break;
default:
// Skip not supported type
return;
}
$this->addFilter('fields[' . $profileField->internal_name . ']', $filterData);
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
$t = preg_split('/[ \t]/', trim($enclosure[2]) );
$type = $t[0];
/**
* Filters the RSS enclosure HTML link tag for the current post.
*
* @since 2.2.0
*
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
*/
echo apply_filters( 'rss_enclosure', '<enclosure url="' . esc_url( trim( $enclosure[0] ) ) . '" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( $type ) . '" />' . "\n" );
}
}
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public static function GetNewTransactionId()
{
if (!is_dir(APPROOT.'data/transactions'))
{
if (!is_writable(APPROOT.'data'))
{
throw new Exception('The directory "'.APPROOT.'data" must be writable to the application.');
}
/** @noinspection MkdirRaceConditionInspection */
if (!@mkdir(APPROOT.'data/transactions'))
{
throw new Exception('Failed to create the directory "'.APPROOT.'data/transactions". Ajust the rights on the parent directory or let an administrator create the transactions directory and give the web sever enough rights to write into it.');
}
}
if (!is_writable(APPROOT.'data/transactions'))
{
throw new Exception('The directory "'.APPROOT.'data/transactions" must be writable to the application.');
}
self::CleanupOldTransactions();
$id = basename(tempnam(APPROOT.'data/transactions', static::GetUserPrefix()));
self::Info('GetNewTransactionId: Created transaction: '.$id);
return (string)$id;
} | 0 | PHP | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | vulnerable |
public function getModel()
{
return $this->model;
} | 0 | PHP | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. | https://cwe.mitre.org/data/definitions/22.html | vulnerable |
public function params()
{
$project = $this->getProject();
$values = $this->request->getValues();
if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {
$this->create();
return;
}
$action = $this->actionManager->getAction($values['action_name']);
$action_params = $action->getActionRequiredParameters();
if (empty($action_params)) {
$this->doCreation($project, $values + array('params' => array()));
}
$projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId());
unset($projects_list[$project['id']]);
$this->response->html($this->template->render('action_creation/params', array(
'values' => $values,
'action_params' => $action_params,
'columns_list' => $this->columnModel->getList($project['id']),
'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']),
'projects_list' => $projects_list,
'colors_list' => $this->colorModel->getList(),
'categories_list' => $this->categoryModel->getList($project['id']),
'links_list' => $this->linkModel->getList(0, false),
'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project),
'project' => $project,
'available_actions' => $this->actionManager->getAvailableActions(),
'swimlane_list' => $this->swimlaneModel->getList($project['id']),
'events' => $this->actionManager->getCompatibleEvents($values['action_name']),
)));
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
function update_license_status() {
$status = '';
$license_key = $this->get_license_key();
if (!empty($license_key) || defined('W3TC_LICENSE_CHECK')) {
$license = edd_w3edge_w3tc_check_license($license_key, W3TC_VERSION);
$version = '';
if ($license) {
$status = $license->license;
if ('host_valid' == $status) {
$version = 'pro';
} elseif (in_array($status, array('site_inactive','valid')) && w3tc_is_pro_dev_mode()) {
$status = 'valid';
$version = 'pro_dev';
}
}
$this->_config->set('plugin.type', $version);
} else {
$status = 'no_key';
$this->_config->set('plugin.type', '');
}
try {
$this->_config->save();
} catch(Exception $ex) {}
return $status;
} | 0 | PHP | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | vulnerable |
public static function getKey($var)
{
return self::$hooks[$var];
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function confirm()
{
$project = $this->getProject();
$filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id'));
$this->response->html($this->helper->layout->project('custom_filter/remove', array(
'project' => $project,
'filter' => $filter,
'title' => t('Remove a custom filter')
)));
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
function edit_section() {
global $db, $user;
$parent = new section($this->params['parent']);
if (empty($parent->id)) $parent->id = 0;
assign_to_template(array(
'haveStandalone' => ($db->countObjects('section', 'parent=-1') && $parent->id >= 0),
'parent' => $parent,
'isAdministrator' => $user->isAdmin(),
));
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function getQueryOrderby()
{
return '';
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function setModelAttributes(&$model,&$attributeList,&$params) {
$data = array ();
foreach($attributeList as &$attr) {
if(!isset($attr['name'],$attr['value']))
continue;
if(null !== $field = $model->getField($attr['name'])) {
// first do variable/expression evaluation, // then process with X2Fields::parseValue()
$type = $field->type;
$value = $attr['value'];
if(is_string($value)){
if(strpos($value, '=') === 0){
$evald = X2FlowFormatter::parseFormula($value, $params);
if(!$evald[0])
return false;
$value = $evald[1];
} elseif($params !== null){
if(is_string($value) && isset($params['model'])){
$value = X2FlowFormatter::replaceVariables(
$value, $params['model'], $type);
}
}
}
$data[$attr['name']] = $value;
}
}
if (!isset ($model->scenario))
$model->setScenario ('X2Flow');
$model->setX2Fields ($data);
if ($model instanceof Actions && isset($data['complete'])) {
switch($data['complete']) {
case 'Yes':
$model->complete();
break;
case 'No':
$model->uncomplete();
break;
}
}
return true;
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
$evs = $this->event->find('all', "id=" . $edate->event_id . $featuresql);
foreach ($evs as $key=>$event) {
if ($condense) {
$eventid = $event->id;
$multiday_event = array_filter($events, create_function('$event', 'global $eventid; return $event->id === $eventid;'));
if (!empty($multiday_event)) {
unset($evs[$key]);
continue;
}
}
$evs[$key]->eventstart += $edate->date;
$evs[$key]->eventend += $edate->date;
$evs[$key]->date_id = $edate->id;
if (!empty($event->expCat)) {
$catcolor = empty($event->expCat[0]->color) ? null : trim($event->expCat[0]->color);
// if (substr($catcolor,0,1)=='#') $catcolor = '" style="color:'.$catcolor.';';
$evs[$key]->color = $catcolor;
}
}
if (count($events) < 500) { // magic number to not crash loop?
$events = array_merge($events, $evs);
} else {
// $evs[$key]->title = gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!');
// $events = array_merge($events, $evs);
flash('notice',gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!'));
break; // keep from breaking system by too much data
}
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function doValidate(&$uri, $config, $context) {
$uri->userinfo = null;
$uri->query = null;
return true;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
protected function prepareImport($model, $csvName, $verifyUpload = true) {
$this->openX2 ('/admin/importModels?model='.ucfirst($model));
$csv = implode(DIRECTORY_SEPARATOR, array(
Yii::app()->basePath,
'tests',
'data',
'csvs',
$csvName
));
$this->type ('data', $csv);
$this->clickAndWait ("dom=document.querySelector ('input[type=\"submit\"]')");
if ($verifyUpload)
$this->assertCsvUploaded ($csv);
} | 1 | PHP | CWE-20 | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. | https://cwe.mitre.org/data/definitions/20.html | safe |
function process_subsections($parent_section, $subtpl) {
global $db, $router;
$section = new stdClass();
$section->parent = $parent_section->id;
$section->name = $subtpl->name;
$section->sef_name = $router->encode($section->name);
$section->subtheme = $subtpl->subtheme;
$section->active = $subtpl->active;
$section->public = $subtpl->public;
$section->rank = $subtpl->rank;
$section->page_title = $subtpl->page_title;
$section->keywords = $subtpl->keywords;
$section->description = $subtpl->description;
$section->id = $db->insertObject($section, 'section');
self::process_section($section, $subtpl);
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
function send_feedback() {
$success = false;
if (isset($this->params['id'])) {
$ed = new eventdate($this->params['id']);
// $email_addrs = array();
if ($ed->event->feedback_email != '') {
$msgtemplate = expTemplate::get_template_for_action($this, 'email/_' . expString::escape($this->params['formname']), $this->loc);
$msgtemplate->assign('params', $this->params);
$msgtemplate->assign('event', $ed);
$email_addrs = explode(',', $ed->event->feedback_email);
//This is an easy way to remove duplicates
$email_addrs = array_flip(array_flip($email_addrs));
$email_addrs = array_map('trim', $email_addrs);
$mail = new expMail();
$success += $mail->quickSend(array(
"text_message" => $msgtemplate->render(),
'to' => $email_addrs,
'from' => !empty($this->params['email']) ? $this->params['email'] : trim(SMTP_FROMADDRESS),
'subject' => $this->params['subject'],
));
}
}
if ($success) {
flashAndFlow('message', gt('Your feedback was successfully sent.'));
} else {
flashAndFlow('error', gt('We could not send your feedback. Please contact your administrator.'));
}
} | 1 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | safe |
$db->updateObject($value, 'section');
}
$db->updateObject($moveSec, 'section');
//handle re-ranking of previous parent
$oldSiblings = $db->selectObjects("section", "parent=" . $oldParent . " AND rank>" . $oldRank . " ORDER BY rank");
$rerank = 1;
foreach ($oldSiblings as $value) {
if ($value->id != $moveSec->id) {
$value->rank = $rerank;
$db->updateObject($value, 'section');
$rerank++;
}
}
if ($oldParent != $moveSec->parent) {
//we need to re-rank the children of the parent that the moving section has just left
$childOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank");
for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) {
$childOfLastMove[$i]->rank = $i;
$db->updateObject($childOfLastMove[$i], 'section');
}
}
}
}
self::checkForSectionalAdmins($move);
expSession::clearAllUsersSessionCache('navigation');
}
| 0 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | vulnerable |
$section = new section($this->params);
} else {
notfoundController::handle_not_found();
exit;
}
if (!empty($section->id)) {
$check_id = $section->id;
} else {
$check_id = $section->parent;
}
if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $check_id))) {
if (empty($section->id)) {
$section->active = 1;
$section->public = 1;
if (!isset($section->parent)) {
// This is another precaution. The parent attribute
// should ALWAYS be set by the caller.
//FJD - if that's the case, then we should die.
notfoundController::handle_not_authorized();
exit;
//$section->parent = 0;
}
}
assign_to_template(array(
'section' => $section,
'glyphs' => self::get_glyphs(),
));
} else { // User does not have permission to manage sections. Throw a 403
notfoundController::handle_not_authorized();
}
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$ret .= $this->element('td', $this->listifyTagLookup($lookup));
$ret .= $this->end('tr');
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
$emails[$u->email] = trim(user::getUserAttribution($u->id));
} | 1 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | safe |
public function approve() {
expHistory::set('editable', $this->params);
/* The global constants can be overriden by passing appropriate params */
//sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
$require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];
$require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];
$require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];
$notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];
if (empty($this->params['id'])) {
flash('error', gt('No ID supplied for note to approve'));
$lastUrl = expHistory::getLast('editable');
}
$simplenote = new expSimpleNote($this->params['id']);
assign_to_template(array(
'simplenote'=>$simplenote,
'require_login'=>$require_login,
'require_approval'=>$require_approval,
'require_notification'=>$require_notification,
'notification_email'=>$notification_email,
'tab'=>$this->params['tab']
));
} | 1 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | safe |
public function isUsed($id)
{
try {
$select = $this->zdb->select($this->used);
$select->where($this->fpk . ' = ' . $id);
$results = $this->zdb->execute($select);
$result = $results->current();
if ($result !== null) {
return true;
} else {
return false;
}
} catch (Throwable $e) {
Analog::log(
'Unable to check if ' . $this->getType . ' `' . $id .
'` is used. | ' . $e->getMessage(),
Analog::ERROR
);
//in case of error, we consider that it is used, to avoid errors
return true;
}
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
protected function make($path, $name, $mime) {
$sql = 'INSERT INTO %s (`parent_id`, `name`, `size`, `mtime`, `mime`, `content`, `read`, `write`) VALUES (\'%s\', \'%s\', 0, %d, \'%s\', \'\', \'%d\', \'%d\')';
$sql = sprintf($sql, $this->tbf, $path, $this->db->real_escape_string($name), time(), $mime, $this->defaults['read'], $this->defaults['write']);
// echo $sql;
return $this->query($sql) && $this->db->affected_rows > 0;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
static function displayname() { return gt("Navigation"); } | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$section = new section(intval($page));
if ($section) {
// self::deleteLevel($section->id);
$section->delete();
}
}
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$q = self::$mysqli->query($vars) ;
if($q === false) {
Control::error('db',"Query failed: ".self::$mysqli->error."<br />\n");
}
}
return $q;
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
protected function _downloadErrorLog()
{
$tmpDir = TMP . 'logs' . DS;
$Folder = new Folder($tmpDir);
$files = $Folder->read(true, true, false);
if (count($files[0]) === 0 && count($files[1]) === 0) {
return false;
}
// ZIP圧縮して出力
$fileName = 'basercms_logs_' . date('Ymd_His');
$Simplezip = new Simplezip();
$Simplezip->addFolder($tmpDir);
$Simplezip->download($fileName);
return true;
} | 0 | PHP | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
public function testConnectAndEmptyRebind()
{
// Simple working connect and privileged bind.
$ldap = new Horde_Ldap(self::$ldapcfg['server']);
$ldap->bind(self::$ldapcfg['server']['binddn'], '');
} | 1 | PHP | CWE-287 | Improper Authentication | When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct. | https://cwe.mitre.org/data/definitions/287.html | safe |
public function update_groupdiscounts() {
global $db;
if (empty($this->params['id'])) {
// look for existing discounts for the same group
$existing_id = $db->selectValue('groupdiscounts', 'id', 'group_id='.$this->params['group_id']);
if (!empty($existing_id)) flashAndFlow('error',gt('There is already a discount for that group.'));
}
$gd = new groupdiscounts();
$gd->update($this->params);
expHistory::back();
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public static function factory($type)
{
include_once './libraries/gis/GIS_Geometry.class.php';
$type_lower = strtolower($type);
if (! PMA_isValid($type_lower, PMA_Util::getGISDatatypes())
|| ! file_exists('./libraries/gis/GIS_' . ucfirst($type_lower) . '.class.php')
) {
return false;
}
if (include_once './libraries/gis/GIS_' . ucfirst($type_lower) . '.class.php') {
switch(strtoupper($type)) {
case 'MULTIPOLYGON' :
return PMA_GIS_Multipolygon::singleton();
case 'POLYGON' :
return PMA_GIS_Polygon::singleton();
case 'MULTIPOINT' :
return PMA_GIS_Multipoint::singleton();
case 'POINT' :
return PMA_GIS_Point::singleton();
case 'MULTILINESTRING' :
return PMA_GIS_Multilinestring::singleton();
case 'LINESTRING' :
return PMA_GIS_Linestring::singleton();
case 'GEOMETRYCOLLECTION' :
return PMA_GIS_Geometrycollection::singleton();
default :
return false;
}
} else {
return false;
}
} | 1 | PHP | CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. | https://cwe.mitre.org/data/definitions/22.html | safe |
$emails[$u->email] = trim(user::getUserAttribution($u->id));
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
function delete() {
global $db;
if (empty($this->params['id'])) return false;
$product_type = $db->selectValue('product', 'product_type', 'id=' . $this->params['id']);
$product = new $product_type($this->params['id'], true, false);
//eDebug($product_type);
//eDebug($product, true);
//if (!empty($product->product_type_id)) {
//$db->delete($product_type, 'id='.$product->product_id);
//}
$db->delete('option', 'product_id=' . $product->id . " AND optiongroup_id IN (SELECT id from " . $db->prefix . "optiongroup WHERE product_id=" . $product->id . ")");
$db->delete('optiongroup', 'product_id=' . $product->id);
//die();
$db->delete('product_storeCategories', 'product_id=' . $product->id . ' AND product_type="' . $product_type . '"');
if ($product->product_type == "product") {
if ($product->hasChildren()) {
$this->deleteChildren();
}
}
$product->delete();
flash('message', gt('Product deleted successfully.'));
expHistory::back();
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$this->inTable(array(
'name' => 'colgroup',
'type' => HTML5::STARTTAG,
'attr' => array()
)); | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function show()
{
$task = $this->getTask();
$subtask = $this->getSubtask();
$this->response->html($this->template->render('subtask_converter/show', array(
'subtask' => $subtask,
'task' => $task,
)));
} | 0 | PHP | CWE-200 | Exposure of Sensitive Information to an Unauthorized Actor | The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. | https://cwe.mitre.org/data/definitions/200.html | vulnerable |
public function testPregReplaceCallback () {
$str = self::$dummyString;
$pattern = '/\d+/';
$replacement = '';
$callback = function (array $matches) {
return 'a';
};
$this->assertEquals (
preg_replace_callback ($pattern, $callback, $str),
StringUtil::pregReplaceCallback ($pattern, $callback, $str)
);
$this->assertEquals (
preg_replace_callback ($pattern, $callback, $str, 1),
StringUtil::pregReplaceCallback ($pattern, $callback, $str, 1)
);
$countA = null;
$countB = null;
$this->assertEquals (
preg_replace_callback ($pattern, $callback, $str, 1, $countA),
StringUtil::pregReplaceCallback ($pattern, $callback, $str, 1, $countB)
);
} | 1 | PHP | CWE-20 | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. | https://cwe.mitre.org/data/definitions/20.html | safe |
private function isOk()
{
return $this->error === UPLOAD_ERR_OK;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = false) {
$this->outputPrecision = $output_precision;
$this->internalPrecision = $internal_precision;
$this->bcmath = !$force_no_bcmath && function_exists('bcmul');
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
function escape_command($command) {
return preg_replace("/(\\\$|;`)/", "", $command);
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public static function fixName($name) {
$name = preg_replace('/[^A-Za-z0-9\.]/','_',$name);
if ($name[0] == '.') // attempt to upload a dot file
$name[0] = '_';
$name = str_replace('_', '..', $name); // attempt to upload with redirection to new folder
return $name;
// return preg_replace('/[^A-Za-z0-9\.]/', '-', $name);
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
function testMissingExtensionFatal()
{
$ext = 'php_ext';
$warn = 'The <a href="' . PMA_getPHPDocLink('book.' . $ext . '.php')
. '" target="Documentation"><em>' . $ext
. '</em></a> extension is missing. Please check your PHP configuration.';
$this->expectOutputRegex('@' . preg_quote($warn) . '@');
PMA_warnMissingExtension($ext, true);
} | 0 | PHP | CWE-94 | Improper Control of Generation of Code ('Code Injection') | The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. | https://cwe.mitre.org/data/definitions/94.html | vulnerable |
function manage () {
expHistory::set('viewable', $this->params);
$vendor = new vendor();
$vendors = $vendor->find('all');
if(!empty($this->params['vendor'])) {
$purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']);
} else {
$purchase_orders = $this->purchase_order->find('all');
}
assign_to_template(array(
'purchase_orders'=>$purchase_orders,
'vendors' => $vendors,
'vendor_id' => @$this->params['vendor']
));
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function add($def, $config) {
$status = parent::add($def, $config);
if ($status) $this->definitions[$this->generateKey($config)] = $def;
return $status;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function update()
{
$project = $this->getProject();
$tag_id = $this->request->getIntegerParam('tag_id');
$tag = $this->tagModel->getById($tag_id);
$values = $this->request->getValues();
list($valid, $errors) = $this->tagValidator->validateModification($values);
if ($tag['project_id'] != $project['id']) {
throw new AccessForbiddenException();
}
if ($valid) {
if ($this->tagModel->update($values['id'], $values['name'])) {
$this->flash->success(t('Tag updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this tag.'));
}
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
} else {
$this->edit($values, $errors);
}
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
public function beforeFilter() { // TODO REMOVE
parent::beforeFilter();
$this->Security->unlockedActions = array('saveElementSorting', 'populateEventFromTemplate', 'uploadFile', 'deleteTemporaryFile');
} | 0 | PHP | CWE-94 | Improper Control of Generation of Code ('Code Injection') | The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. | https://cwe.mitre.org/data/definitions/94.html | vulnerable |
$loc = expCore::makeLocation('navigation', '', $standalone->id);
if (expPermissions::check('manage', $loc)) return true;
}
return false;
} | 1 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | safe |
$tokens = $strategy->execute($tokens, $config, $context);
}
return $tokens;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function testSandboxUnallowedToStringArray()
{
$twig = $this->getEnvironment(true, [], self::$templates);
try {
$twig->load('1_basic6')->render(self::$params);
$this->fail('Sandbox throws a SecurityError exception if an unallowed method (__toString()) is called in the template');
} catch (SecurityError $e) {
$this->assertInstanceOf('\Twig\Sandbox\SecurityNotAllowedMethodError', $e, 'Exception should be an instance of Twig_Sandbox_SecurityNotAllowedMethodError');
$this->assertEquals('FooObject', $e->getClassName(), 'Exception should be raised on the "FooObject" class');
$this->assertEquals('__tostring', $e->getMethodName(), 'Exception should be raised on the "__toString" method');
}
} | 0 | PHP | NVD-CWE-noinfo | null | null | null | vulnerable |
public function delete_version() {
if (empty($this->params['id'])) {
flash('error', gt('The version you are trying to delete could not be found'));
}
// get the version
$version = new help_version($this->params['id']);
if (empty($version->id)) {
flash('error', gt('The version you are trying to delete could not be found'));
}
// if we have errors than lets get outta here!
if (!expQueue::isQueueEmpty('error')) expHistory::back();
// delete the version
$version->delete();
expSession::un_set('help-version');
flash('message', gt('Deleted version').' '.$version->version.' '.gt('and all documents in that version.'));
expHistory::back();
} | 0 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | vulnerable |
function captureAuthorization() {
//eDebug($this->params,true);
$order = new order($this->params['id']);
/*eDebug($this->params);
//eDebug($order,true);*/
//eDebug($order,true);
//$billing = new billing();
//eDebug($billing, true);
//$billing->calculator = new $calcname($order->billingmethod[0]->billingcalculator_id);
$calc = $order->billingmethod[0]->billingcalculator->calculator;
$calc->config = $order->billingmethod[0]->billingcalculator->config;
//$calc = new $calc-
//eDebug($calc,true);
if (!method_exists($calc, 'delayed_capture')) {
flash('error', gt('The Billing Calculator does not support delayed capture'));
expHistory::back();
}
$result = $calc->delayed_capture($order->billingmethod[0], $this->params['capture_amt'], $order);
if (empty($result->errorCode)) {
flash('message', gt('The authorized payment was successfully captured'));
expHistory::back();
} else {
flash('error', gt('An error was encountered while capturing the authorized payment.') . '<br /><br />' . $result->message);
expHistory::back();
}
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function getMissingAmount()
{
if (empty($this->_id)) {
return (double)$this->amount;
}
try {
$select = $this->zdb->select(Contribution::TABLE);
$select->columns(
array(
'sum' => new Expression('SUM(montant_cotis)')
)
)->where(self::PK . ' = ' . $this->_id);
$results = $this->zdb->execute($select);
$result = $results->current();
$dispatched_amount = $result->sum;
return (double)$this->_amount - (double)$dispatched_amount;
} catch (Throwable $e) {
Analog::log(
'An error occurred retrieving missing amounts | ' .
$e->getMessage(),
Analog::ERROR
);
throw $e;
}
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function addTags($tags) {
$result = false;
$addedTags = array();
foreach ((array) $tags as $tagName) {
if (empty($tagName))
continue;
if (!$this->hasTag ($tagName)) { // check for duplicate tag
$tag = new Tags;
$tag->tag = Tags::normalizeTag ($tagName);
$tag->itemId = $this->getOwner()->id;
$tag->type = get_class($this->getOwner());
$tag->taggedBy = Yii::app()->getSuName();
$tag->timestamp = time();
$tag->itemName = $this->getOwner()->name;
if ($tag->save()) {
$this->_tags[] = $tag->tag; // update tag cache
$addedTags[] = $tagName;
$result = true;
} else {
throw new CHttpException(
422, 'Failed saving tag due to errors: ' . json_encode($tag->errors));
}
}
}
if ($this->flowTriggersEnabled)
X2Flow::trigger('RecordTagAddTrigger', array(
'model' => $this->getOwner(),
'tags' => $addedTags,
));
return $result;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
function compression_test() {
?>
<script type="text/javascript">
var testCompression = {
get : function(test) {
var x;
if ( window.XMLHttpRequest ) {
x = new XMLHttpRequest();
} else {
try{x=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{x=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){};}
}
if (x) {
x.onreadystatechange = function() {
var r, h;
if ( x.readyState == 4 ) {
r = x.responseText.substr(0, 18);
h = x.getResponseHeader('Content-Encoding');
testCompression.check(r, h, test);
}
};
x.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&'+(new Date()).getTime(), true);
x.send('');
}
},
check : function(r, h, test) {
if ( ! r && ! test )
this.get(1);
if ( 1 == test ) {
if ( h && ( h.match(/deflate/i) || h.match(/gzip/i) ) )
this.get('no');
else
this.get(2);
return;
}
if ( 2 == test ) {
if ( '"wpCompressionTest' == r )
this.get('yes');
else
this.get('no');
}
}
};
testCompression.check();
</script>
<?php
} | 0 | PHP | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | vulnerable |
public function testCanConstructWithHeaders()
{
$r = new Response(200, ['Foo' => 'Bar']);
$this->assertSame(['Foo' => ['Bar']], $r->getHeaders());
$this->assertSame('Bar', $r->getHeaderLine('Foo'));
$this->assertSame(['Bar'], $r->getHeader('Foo'));
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function update()
{
$project = $this->getProject();
$tag_id = $this->request->getIntegerParam('tag_id');
$tag = $this->tagModel->getById($tag_id);
$values = $this->request->getValues();
list($valid, $errors) = $this->tagValidator->validateModification($values);
if ($tag['project_id'] != $project['id']) {
throw new AccessForbiddenException();
}
if ($valid) {
if ($this->tagModel->update($values['id'], $values['name'])) {
$this->flash->success(t('Tag updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this tag.'));
}
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
} else {
$this->edit($values, $errors);
}
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
public function actionGetItems($term){
X2LinkableBehavior::getItems ($term);
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public static function getTestHost () {
return preg_replace ('/^https?:\/\/([^\/]+)\/.*$/', '$1', TEST_WEBROOT_URL);
} | 1 | PHP | CWE-20 | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. | https://cwe.mitre.org/data/definitions/20.html | safe |
private function getSwimlane()
{
$swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id'));
if (empty($swimlane)) {
throw new PageNotFoundException();
}
return $swimlane;
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
function _checkLoginNew()
{
$oPlugin = new Plugins_Authentication();
$aCredentials = $oPlugin->_getCredentials(false);
if (!PEAR::isError($aCredentials)) {
phpAds_SessionRegenerateId();
$doUser = $oPlugin->checkPassword($aCredentials['username'], $aCredentials['password']);
if ($doUser) {
phpAds_SessionDataRegister(OA_Auth::getSessionData($doUser));
}
}
phpAds_SessionDataStore();
} | 1 | PHP | CWE-384 | Session Fixation | Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions. | https://cwe.mitre.org/data/definitions/384.html | safe |
foreach ($events as $event) {
$extevents[$date][] = $event;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
private function getResponse ($size = 128) {
$pop3_response = fgets($this->pop_conn, $size);
return $pop3_response;
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
function PMA_findExistingColNames($db, $cols, $allFields=false)
{
$cfgCentralColumns = PMA_centralColumnsGetParams();
if (empty($cfgCentralColumns)) {
return array();
}
$pmadb = $cfgCentralColumns['db'];
$GLOBALS['dbi']->selectDb($pmadb, $GLOBALS['controllink']);
$central_list_table = $cfgCentralColumns['table'];
if ($allFields) {
$query = 'SELECT * FROM ' . Util::backquote($central_list_table) . ' '
. 'WHERE db_name = \'' . Util::sqlAddSlashes($db) . '\' AND col_name IN (' . $cols . ');';
$has_list = (array) $GLOBALS['dbi']->fetchResult(
$query, null, null, $GLOBALS['controllink']
);
PMA_handleColumnExtra($has_list);
} else {
$query = 'SELECT col_name FROM '
. Util::backquote($central_list_table) . ' '
. 'WHERE db_name = \'' . Util::sqlAddSlashes($db) . '\' AND col_name IN (' . $cols . ');';
$has_list = (array) $GLOBALS['dbi']->fetchResult(
$query, null, null, $GLOBALS['controllink']
);
}
return $has_list;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$alt = __esc('Export');
}
if ($force_type != 'import' && $force_type != 'export' && $force_type != 'save' && $cancel_url != '') {
$cancel_action = "<input type='button' onClick='cactiReturnTo(\"" . htmlspecialchars($cancel_url) . "\")' value='" . $calt . "'>";
} else {
$cancel_action = '';
}
?>
<table style='width:100%;text-align:center;'>
<tr>
<td class='saveRow'>
<input type='hidden' name='action' value='save'>
<?php print $cancel_action;?>
<input class='<?php print $force_type;?>' id='submit' type='submit' value='<?php print $alt;?>'>
</td>
</tr>
</table>
<?php
form_end($ajax);
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
static function convertUTF($string) {
return $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8'));
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
$this->setType('folder');
}
// do not allow PHP and .htaccess files
if (preg_match("@\.ph(p[\d+]?|t|tml|ps)$@i", $this->getFilename()) || $this->getFilename() == '.htaccess') {
$this->setFilename($this->getFilename() . '.txt');
}
if(mb_strlen($this->getFilename()) > 255) {
throw new \Exception('Filenames longer than 255 characters are not allowed');
}
if (Asset\Service::pathExists($this->getRealFullPath())) {
$duplicate = Asset::getByPath($this->getRealFullPath());
if ($duplicate instanceof Asset and $duplicate->getId() != $this->getId()) {
throw new \Exception('Duplicate full path [ ' . $this->getRealFullPath() . ' ] - cannot save asset');
}
}
$this->validatePathLength();
} | 1 | PHP | CWE-434 | Unrestricted Upload of File with Dangerous Type | The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. | https://cwe.mitre.org/data/definitions/434.html | safe |
public function addModule($module) {
$this->registerModule($module);
if (is_object($module)) $module = $module->name;
$this->userModules[] = $module;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
private function _notuses( $option ) {
if ( count( $option ) > 0 ) {
$where = $this->tableNames['page'] . '.page_id NOT IN (SELECT ' . $this->tableNames['templatelinks'] . '.tl_from FROM ' . $this->tableNames['templatelinks'] . ' WHERE (';
$ors = [];
foreach ( $option as $linkGroup ) {
foreach ( $linkGroup as $link ) {
$_or = '(' . $this->tableNames['templatelinks'] . '.tl_namespace=' . intval( $link->getNamespace() );
if ( $this->parameters->getParameter( 'ignorecase' ) ) {
$_or .= ' AND LOWER(CAST(' . $this->tableNames['templatelinks'] . '.tl_title AS char))=LOWER(' . $this->DB->addQuotes( $link->getDbKey() ) . '))';
} else {
$_or .= ' AND ' . $this->tableNames['templatelinks'] . '.tl_title=' . $this->DB->addQuotes( $link->getDbKey() ) . ')';
}
$ors[] = $_or;
}
}
$where .= implode( ' OR ', $ors ) . '))';
}
$this->addWhere( $where );
} | 0 | PHP | CWE-400 | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | vulnerable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.