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 checkSecurity($tags, $filters, $functions) { }
1
PHP
NVD-CWE-Other
Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
https://nvd.nist.gov/vuln/categories
safe
public function withCookieHeader(RequestInterface $request) { $values = []; $uri = $request->getUri(); $scheme = $uri->getScheme(); $host = $uri->getHost(); $path = $uri->getPath() ?: '/'; foreach ($this->cookies as $cookie) { if ($cookie->matchesPath($path) && $cookie->matchesDomain($host) && !$cookie->isExpired() && (!$cookie->getSecure() || $scheme == 'https') ) { $values[] = $cookie->getName() . '=' . self::getCookieValue($cookie->getValue()); } } return $values ? $request->withHeader('Cookie', implode('; ', $values)) : $request; }
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
$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
public function __construct(public Request $Request, public SessionInterface $Session, public Config $Config, public Logger $Log, public Csrf $Csrf) { $flashBag = $this->Session->getBag('flashes'); // add type check because SessionBagInterface doesn't have get(), only FlashBag has it if ($flashBag instanceof FlashBag) { $this->ok = $flashBag->get('ok'); $this->ko = $flashBag->get('ko'); $this->warning = $flashBag->get('warning'); } $this->Log->pushHandler(new ErrorLogHandler()); $this->Users = new Users(); $this->Db = Db::getConnection(); // UPDATE SQL SCHEMA if necessary or show error message if version mismatch $Update = new Update($this->Config, new Sql()); $Update->checkSchema(); }
0
PHP
CWE-307
Improper Restriction of Excessive Authentication Attempts
The software does not implement sufficient measures to prevent multiple failed authentication attempts within in a short time frame, making it more susceptible to brute force attacks.
https://cwe.mitre.org/data/definitions/307.html
vulnerable
function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); }
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 testLegacyDispatch() { $event = new Event(); $return = $this->dispatcher->dispatch(self::preFoo, $event); $this->assertEquals('pre.foo', $event->getName()); }
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
$comments->records[$key]->avatar = $db->selectObject('user_avatar',"user_id='".$record->poster."'"); } if (empty($this->params['config']['disable_nested_comments'])) $comments->records = self::arrangecomments($comments->records); // eDebug($sql, true); // count the unapproved comments if ($require_approval == 1 && $user->isAdmin()) { $sql = 'SELECT count(com.id) as c FROM '.$db->prefix.'expComments com '; $sql .= 'JOIN '.$db->prefix.'content_expComments cnt ON com.id=cnt.expcomments_id '; $sql .= 'WHERE cnt.content_id='.$this->params['content_id']." AND cnt.content_type='".$this->params['content_type']."' "; $sql .= 'AND com.approved=0'; $unapproved = $db->countObjectsBySql($sql); } else { $unapproved = 0; } $this->config = $this->params['config']; $type = !empty($this->params['type']) ? $this->params['type'] : gt('Comment'); $ratings = !empty($this->params['ratings']) ? true : false; assign_to_template(array( 'comments'=>$comments, 'config'=>$this->params['config'], 'unapproved'=>$unapproved, 'content_id'=>$this->params['content_id'], 'content_type'=>$this->params['content_type'], 'user'=>$user, 'hideform'=>$this->params['hideform'], 'hidecomments'=>$this->params['hidecomments'], 'title'=>$this->params['title'], 'formtitle'=>$this->params['formtitle'], 'type'=>$type, 'ratings'=>$ratings, 'require_login'=>$require_login, 'require_approval'=>$require_approval, 'require_notification'=>$require_notification, 'notification_email'=>$notification_email, )); }
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 ($cf_d as $cfd_i => $cfd_d) { if ($cfd_i == 'TYPE') { $fc = substr($cfd_d, 0, 1); $lc = substr($cfd_d, 1); $cfd_d = strtoupper($fc) . $lc; $get_schools_cf[$cf_i][$cfd_i] = $cfd_d; unset($fc); unset($lc); } if ($cfd_i == 'SELECT_OPTIONS' && $cf_d['TYPE'] != 'text') { for ($i = 0; $i < strlen($cfd_d); $i++) { $char = substr($cfd_d, $i, 1); if (ord($char) == '13') $char = '<br/>'; $new_char[] = $char; } $cfd_d = implode('', $new_char); $get_schools_cf[$cf_i][$cfd_i] = $cfd_d; unset($char); unset($new_char); } if ($cfd_i == 'SYSTEM_FIELD' || $cfd_i == 'REQUIRED') { if ($cfd_d == 'N') $get_schools_cf[$cf_i][$cfd_i] = 'No'; if ($cfd_d == 'Y') $get_schools_cf[$cf_i][$cfd_i] = 'Yes'; } }
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 maybeGetRawCSSDefinition() { return $this->getDefinition('CSS', true, 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
public function __construct() { $this->phase = self::INIT_PHASE; $this->mode = self::BEFOR_HEAD; $this->dom = new DOMDocument; $this->dom->encoding = 'UTF-8'; $this->dom->preserveWhiteSpace = true; $this->dom->substituteEntities = true; $this->dom->strictErrorChecking = 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 manage_messages() { expHistory::set('manageable', $this->params); $page = new expPaginator(array( 'model'=>'order_status_messages', 'where'=>1, 'limit'=>10, 'order'=>'body', 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->params['controller'], 'action'=>$this->params['action'], //'columns'=>array('Name'=>'title') )); //eDebug($page); assign_to_template(array( 'page'=>$page )); }
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 testTransactionSearch() { $transactionSearch = $this->gateway->transactionSearch(array( 'startDate' => '2015-01-01', 'endDate' => '2015-12-31' )); $this->assertInstanceOf('\Omnipay\PayPal\Message\ExpressTransactionSearchRequest', $transactionSearch); $this->assertInstanceOf('\DateTime', $transactionSearch->getStartDate()); $this->assertInstanceOf('\DateTime', $transactionSearch->getEndDate()); }
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 db_seq_nextval($seqname) { global $DatabaseType; if ($DatabaseType == 'mysqli') $seq = "fn_" . strtolower($seqname) . "()"; return $seq; }
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 static function format($date, $format = '') { $timezone = self::$timezone; //Options::v('timezone'); $time = strtotime($date); (empty($format)) ? $format = 'j F Y H:i A T' : $format = $format; $date = new DateTime($date); $date->setTimezone(new DateTimeZone(self::$timezone)); $newdate = $date->format($format); return $newdate; }
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
$ip = getenv('HTTP_FORWARDED'); } else { $ip = $_SERVER['REMOTE_ADDR']; } return $ip; }
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 edit() { global $user; /* 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['formtitle'])) { if (empty($this->params['id'])) { $formtitle = gt("Add New Note"); } else { $formtitle = gt("Edit Note"); } } else { $formtitle = $this->params['formtitle']; } $id = empty($this->params['id']) ? null : $this->params['id']; $simpleNote = new expSimpleNote($id); //FIXME here is where we might sanitize the note before displaying/editing it assign_to_template(array( 'simplenote'=>$simpleNote, 'user'=>$user, 'require_login'=>$require_login, 'require_approval'=>$require_approval, 'require_notification'=>$require_notification, 'notification_email'=>$notification_email, 'formtitle'=>$formtitle, 'content_type'=>$this->params['content_type'], 'content_id'=>$this->params['content_id'], 'tab'=>empty($this->params['tab'])?0:$this->params['tab'] )); }
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 isBlacklisted($ip, $username) { // first remove old expired rows $this->clean(); // count $params = array('conditions' => array( 'Bruteforce.ip' => $ip, 'Bruteforce.username' => $username),); $count = $this->find('count', $params); if ($count >= Configure::read('SecureAuth.amount')) { return true; } else { return false; } }
0
PHP
CWE-367
Time-of-check Time-of-use (TOCTOU) Race Condition
The software checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. This can cause the software to perform invalid actions when the resource is in an unexpected state.
https://cwe.mitre.org/data/definitions/367.html
vulnerable
function selectArraysBySql($sql) { $res = @mysqli_query($this->connection, $this->injectProof($sql)); if ($res == null) return array(); $arrays = array(); for ($i = 0, $iMax = mysqli_num_rows($res); $i < $iMax; $i++) $arrays[] = mysqli_fetch_assoc($res); return $arrays; }
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 isLocal() { $localhosts = array('::1', '127.0.0.1', '0.0.0.0'); return ( in_array(server::get('SERVER_ADDR'), $localhosts) || server::get('SERVER_NAME') == 'localhost' || str::endsWith(server::get('SERVER_NAME'), '.localhost') || str::endsWith(server::get('SERVER_NAME'), '.test') ); }
0
PHP
CWE-346
Origin Validation Error
The software does not properly verify that the source of data or communication is valid.
https://cwe.mitre.org/data/definitions/346.html
vulnerable
$digits = $integer = substr($integer, 1); // rm unnecessary plus } else { $digits = $integer; } // test if it's numeric if (!ctype_digit($digits)) return false; // perform scope tests if (!$this->zero && $integer == 0) return false; if (!$this->positive && $integer > 0) return false; if (!$this->negative && $integer < 0) return false; return $integer; }
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 theme($var, $data='') { if (isset($data)) { # code... $GLOBALS['data'] = $data; } if (self::exist($var)) { include(GX_THEME.THEME.'/'.$var.'.php'); }else{ Control::error('unknown','Theme file is missing.'); } }
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 addBlankElement($element_name) { $module = $this->getAnonymousModule(); $element = $module->addBlankElement($element_name); return $element; }
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 mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); }
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
protected function convertToLookup($string) { $array = explode('|', str_replace(' ', '', $string)); $ret = array(); foreach ($array as $i => $k) { $ret[$k] = true; } return $ret; }
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 getSaveValue($value) { if ($this->shouldCleanHtml()) { $value = Html::clean($value); } return $value; }
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
$this->inBody($token); /* Anything else */ } else { /* Parse error. Ignore the token. */ } }
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 inc($vars, $data, $dir) { $file = $dir.'/'.$vars.'.php'; if (file_exists($file)) { include $file; } }
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() { global $user; if (expSession::get('customer-signup')) expSession::set('customer-signup', false); if (isset($this->params['address_country_id'])) { $this->params['country'] = $this->params['address_country_id']; unset($this->params['address_country_id']); } if (isset($this->params['address_region_id'])) { $this->params['state'] = $this->params['address_region_id']; unset($this->params['address_region_id']); } if ($user->isLoggedIn()) { // check to see how many other addresses this user has already. $count = $this->address->find('count', 'user_id='.$user->id); // if this is first address save for this user we'll make this the default if ($count == 0) { $this->params['is_default'] = 1; $this->params['is_billing'] = 1; $this->params['is_shipping'] = 1; } // associate this address with the current user. $this->params['user_id'] = $user->id; // save the object $this->address->update($this->params); } else { //if (ecomconfig::getConfig('allow_anonymous_checkout')){ //user is not logged in, but allow anonymous checkout is enabled so we'll check //a few things that we don't check in the parent 'stuff and create a user account. $this->params['is_default'] = 1; $this->params['is_billing'] = 1; $this->params['is_shipping'] = 1; $this->address->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 function delete() { global $user; $count = $this->address->find('count', 'user_id=' . $user->id); if($count > 1) { $address = new address($this->params['id']); if ($user->isAdmin() || ($user->id == $address->user_id)) { if ($address->is_billing) { $billAddress = $this->address->find('first', 'user_id=' . $user->id . " AND id != " . $address->id); $billAddress->is_billing = true; $billAddress->save(); } if ($address->is_shipping) { $shipAddress = $this->address->find('first', 'user_id=' . $user->id . " AND id != " . $address->id); $shipAddress->is_shipping = true; $shipAddress->save(); } parent::delete(); } } else { flash("error", gt("You must have at least one address.")); } 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 headerTestController($serverPort) { $args = array('Authorization' => 'foo'); var_dump(request(php_uname('n'), $serverPort, "test_headers.php", [], ['PROXY' => 'foobar'], $args)); }
0
PHP
CWE-668
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
https://cwe.mitre.org/data/definitions/668.html
vulnerable
function singleQuoteReplace($param1 = false, $param2 = false, $param3) { return str_replace("'", "''", str_replace("\'", "'", $param3)); }
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 static function parseAndTrimImport($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); // global $db; $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = str_replace("�", "-", $str); $str = str_replace("�", "&#151;", $str); $str = str_replace("�", "&rdquo;", $str); $str = str_replace("�", "&ldquo;", $str); $str = str_replace("\r\n", " ", $str); $str = str_replace("\,", ",", $str); $str = str_replace('""', '"', $str); //do this no matter what...in case someone added a quote in a non HTML field if (!$isHTML) { //if HTML, then leave the single quotes alone, otheriwse replace w/ special Char $str = str_replace('"', "&quot;", $str); } $str = str_replace("�", "&#188;", $str); $str = str_replace("�", "&#189;", $str); $str = str_replace("�", "&#190;", $str); //$str = htmlspecialchars($str); //$str = utf8_encode($str); // if (DB_ENGINE=='mysqli') { // $str = @mysqli_real_escape_string($db->connection,trim(str_replace("�", "&trade;", $str))); // } elseif(DB_ENGINE=='mysql') { // $str = @mysql_real_escape_string(trim(str_replace("�", "&trade;", $str)),$db->connection); // } else { // $str = trim(str_replace("�", "&trade;", $str)); // } $str = @expString::escape(trim(str_replace("�", "&trade;", $str))); //echo "2<br>"; eDebug($str,die); return $str; }
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 edit() { global $user; /* 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['formtitle'])) { if (empty($this->params['id'])) { $formtitle = gt("Add New Note"); } else { $formtitle = gt("Edit Note"); } } else { $formtitle = $this->params['formtitle']; } $id = empty($this->params['id']) ? null : $this->params['id']; $simpleNote = new expSimpleNote($id); //FIXME here is where we might sanitize the note before displaying/editing it assign_to_template(array( 'simplenote'=>$simpleNote, 'user'=>$user, 'require_login'=>$require_login, 'require_approval'=>$require_approval, 'require_notification'=>$require_notification, 'notification_email'=>$notification_email, 'formtitle'=>$formtitle, 'content_type'=>$this->params['content_type'], 'content_id'=>$this->params['content_id'], 'tab'=>empty($this->params['tab'])?0:$this->params['tab'] )); }
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 remove() { $this->checkCSRFParam(); $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); if ($tag['project_id'] != $project['id']) { throw new AccessForbiddenException(); } if ($this->tagModel->remove($tag_id)) { $this->flash->success(t('Tag removed successfully.')); } else { $this->flash->failure(t('Unable to remove this tag.')); } $this->response->redirect($this->helper->url->to('ProjectTagController', '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
public static function parseAndTrim($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); // global $db; $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = str_replace("�", "-", $str); $str = str_replace("�", "&#151;", $str); $str = str_replace("�", "&rdquo;", $str); $str = str_replace("�", "&ldquo;", $str); $str = str_replace("\r\n", " ", $str); //$str = str_replace(",","\,",$str); $str = str_replace('\"', "&quot;", $str); $str = str_replace('"', "&quot;", $str); $str = str_replace("�", "&#188;", $str); $str = str_replace("�", "&#189;", $str); $str = str_replace("�", "&#190;", $str); //$str = htmlspecialchars($str); //$str = utf8_encode($str); // if (DB_ENGINE=='mysqli') { // $str = @mysqli_real_escape_string($db->connection,trim(str_replace("�", "&trade;", $str))); // } elseif(DB_ENGINE=='mysql') { // $str = @mysql_real_escape_string(trim(str_replace("�", "&trade;", $str)),$db->connection); // } else { // $str = trim(str_replace("�", "&trade;", $str)); // } $str = @expString::escape(trim(str_replace("�", "&trade;", $str))); //echo "2<br>"; eDebug($str,die); return $str; }
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
function reparent_standalone() { $standalone = $this->section->find($this->params['page']); if ($standalone) { $standalone->parent = $this->params['parent']; $standalone->update(); expSession::clearAllUsersSessionCache('navigation'); expHistory::back(); } else { notfoundController::handle_not_found(); } }
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 ( $metric_group_members as $index => $metric_name ) { print " <A HREF=\"./graph_all_periods.php?mobile=1&" . $g_metrics[$metric_name]['graph'] . "\"> <IMG BORDER=0 ALT=\"".htmlspecialchars($clustername)."\" SRC=\"./graph.php?" . $g_metrics[$metric_name]['graph'] . "\"></A>"; }
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
unset($this->info[$k]->content_model_type); } }
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
$debug_info .= sprintf("%s%s\r\n", str_pad(w3_escape_comment($header_name) . ': ', 20), w3_escape_comment($header_value)); }
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
$n = array(); foreach ($module->info_injector as $i => $injector) { if (!is_object($injector)) { $class = "HTMLPurifier_Injector_$injector"; $injector = new $class; } $n[$injector->name] = $injector; } $module->info_injector = $n; } // setup lookup table based on all valid modules foreach ($this->modules as $module) { foreach ($module->info as $name => $def) { if (!isset($this->elementLookup[$name])) { $this->elementLookup[$name] = array(); } $this->elementLookup[$name][] = $module->name; } } // note the different choice $this->contentSets = new HTMLPurifier_ContentSets( // content set assembly deals with all possible modules, // not just ones deemed to be "safe" $this->modules ); $this->attrCollections = new HTMLPurifier_AttrCollections( $this->attrTypes, // there is no way to directly disable a global attribute, // but using AllowedAttributes or simply not including // the module in your custom doctype should be sufficient $this->modules ); }
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
$this->dom->appendChild($text); } }
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 approve_submit() { global $history; if (empty($this->params['id'])) { flash('error', gt('No ID supplied for comment to approve')); $lastUrl = expHistory::getLast('editable'); } /* 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']; $simplenote = new expSimpleNote($this->params['id']); //FIXME here is where we might sanitize the note before approving it $simplenote->body = $this->params['body']; $simplenote->approved = $this->params['approved']; $simplenote->save(); $lastUrl = makelink($history->history[$history->history['lasts']['type']][count($history->history[$history->history['lasts']['type']])-1]['params']); if (!empty($this->params['tab'])) { $lastUrl .= "#".$this->params['tab']; } redirect_to($lastUrl); }
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 searchCategory() { return gt('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
public function testCompletePurchaseCustomOptions() { $this->setMockHttpResponse('ExpressPurchaseSuccess.txt'); // Those values should not be used if custom token or payerid are passed $this->getHttpRequest()->query->replace(array( 'token' => 'GET_TOKEN', 'PayerID' => 'GET_PAYERID', )); $response = $this->gateway->completePurchase(array( 'amount' => '10.00', 'currency' => 'BYR', 'token' => 'CUSTOM_TOKEN', 'payerid' => 'CUSTOM_PAYERID' ))->send(); $httpRequests = $this->getMockedRequests(); $httpRequest = $httpRequests[0]; $queryArguments = $httpRequest->getQuery()->toArray(); $this->assertSame('CUSTOM_TOKEN', $queryArguments['TOKEN']); $this->assertSame('CUSTOM_PAYERID', $queryArguments['PAYERID']); }
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
$pos = strpos($line, $match); if ($pos !== false) { $var = getvarname(strtok($field, '#')); if ($var != '[]') eval('$r' . $var . '=$block;'); } } } return $r; }
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 edit() { global $user; /* 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['formtitle'])) { if (empty($this->params['id'])) { $formtitle = gt("Add New Note"); } else { $formtitle = gt("Edit Note"); } } else { $formtitle = $this->params['formtitle']; } $id = empty($this->params['id']) ? null : $this->params['id']; $simpleNote = new expSimpleNote($id); //FIXME here is where we might sanitize the note before displaying/editing it assign_to_template(array( 'simplenote'=>$simpleNote, 'user'=>$user, 'require_login'=>$require_login, 'require_approval'=>$require_approval, 'require_notification'=>$require_notification, 'notification_email'=>$notification_email, 'formtitle'=>$formtitle, 'content_type'=>$this->params['content_type'], 'content_id'=>$this->params['content_id'], 'tab'=>empty($this->params['tab'])?0:$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 shouldRun(DateTime $date) { global $timedate; $runDate = clone $date; $this->handleTimeZone($runDate); $cron = Cron\CronExpression::factory($this->schedule); if (empty($this->last_run) && $cron->isDue($runDate)) { return true; } $lastRun = $this->last_run ? $timedate->fromDb($this->last_run) : $timedate->fromDb($this->date_entered); $this->handleTimeZone($lastRun); $next = $cron->getNextRunDate($lastRun); return $next <= $runDate; }
0
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
vulnerable
function import() { $pullable_modules = expModules::listInstalledControllers($this->baseclassname); $modules = new expPaginator(array( 'records' => $pullable_modules, 'controller' => $this->loc->mod, 'action' => $this->params['action'], 'order' => isset($this->params['order']) ? $this->params['order'] : 'section', 'dir' => isset($this->params['dir']) ? $this->params['dir'] : '', 'page' => (isset($this->params['page']) ? $this->params['page'] : 1), 'columns' => array( gt('Title') => 'title', gt('Page') => 'section' ), )); assign_to_template(array( 'modules' => $modules, )); }
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 testAuthCheckAuthFails() { $GLOBALS['cfg']['Server']['auth_swekey_config'] = 'testConfigSwekey'; $GLOBALS['server'] = 1; $_REQUEST['old_usr'] = ''; $_REQUEST['pma_username'] = ''; $_COOKIE['pmaServer-1'] = 'pmaServ1'; $_COOKIE['pmaUser-1'] = 'pmaUser1'; $_COOKIE['pma_iv-1'] = base64_encode('testiv09testiv09'); $GLOBALS['cfg']['blowfish_secret'] = 'secret'; $_SESSION['last_access_time'] = 1; $GLOBALS['cfg']['CaptchaLoginPrivateKey'] = ''; $GLOBALS['cfg']['CaptchaLoginPublicKey'] = ''; $GLOBALS['cfg']['LoginCookieValidity'] = 0; $_SESSION['last_access_time'] = -1; // mock for blowfish function $this->object = $this->getMockBuilder('AuthenticationCookie') ->disableOriginalConstructor() ->setMethods(array('authFails')) ->getMock(); $this->object->expects($this->once()) ->method('authFails'); $this->assertFalse( $this->object->authCheck() ); $this->assertTrue( $GLOBALS['no_activity'] ); }
1
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
safe
function selectBillingOptions() { }
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_tags() { $images = $this->image->find('all'); $used_tags = array(); foreach ($images as $image) { foreach($image->expTag as $tag) { if (isset($used_tags[$tag->id])) { $used_tags[$tag->id]->count++; } else { $exptag = new expTag($tag->id); $used_tags[$tag->id] = $exptag; $used_tags[$tag->id]->count = 1; } } } assign_to_template(array( 'tags'=>$used_tags )); }
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 markCompleted($endStatus, ServiceResponse $serviceResponse, $gatewayMessage) { parent::markCompleted($endStatus, $serviceResponse, $gatewayMessage); $this->createMessage(Message\CreateCardResponse::class, $gatewayMessage); ErrorHandling::safeExtend($this->payment, 'onCardCreated', $serviceResponse); }
0
PHP
CWE-436
Interpretation Conflict
Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.
https://cwe.mitre.org/data/definitions/436.html
vulnerable
public function remove() { $this->checkCSRFParam(); $project = $this->getProject(); $category = $this->getCategory(); if ($this->categoryModel->remove($category['id'])) { $this->flash->success(t('Category removed successfully.')); } else { $this->flash->failure(t('Unable to remove this category.')); } $this->response->redirect($this->helper->url->to('CategoryController', '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
public static function DragnDropReRank2() { global $router, $db; $id = $router->params['id']; $page = new section($id); $old_rank = $page->rank; $old_parent = $page->parent; $new_rank = $router->params['position'] + 1; // rank $new_parent = intval($router->params['parent']); $db->decrement($page->tablename, 'rank', 1, 'rank>' . $old_rank . ' AND parent=' . $old_parent); // close in hole $db->increment($page->tablename, 'rank', 1, 'rank>=' . $new_rank . ' AND parent=' . $new_parent); // make room $params = array(); $params['parent'] = $new_parent; $params['rank'] = $new_rank; $page->update($params); self::checkForSectionalAdmins($id); expSession::clearAllUsersSessionCache('navigation'); }
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 setTimeout($timeout = 0) { $this->Timeout = $timeout; }
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 mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); }
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
unset($return[$key]); } } break; } return @array_change_key_case($return, CASE_UPPER); }
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 static function flagLib () { return "<link href=\"".Site::$url."/assets/css/flag-icon.min.css\" rel=\"stylesheet\">"; }
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 actionGetLists() { if (!Yii::app()->user->checkAccess('ContactsAdminAccess')) { $condition = ' AND (visibility="1" OR assignedTo="Anyone" OR assignedTo="' . Yii::app()->user->getName() . '"'; /* x2temp */ $groupLinks = Yii::app()->db->createCommand()->select('groupId')->from('x2_group_to_user')->where('userId=' . Yii::app()->user->getId())->queryColumn(); if (!empty($groupLinks)) $condition .= ' OR assignedTo IN (' . implode(',', $groupLinks) . ')'; $condition .= ' OR (visibility=2 AND assignedTo IN (SELECT username FROM x2_group_to_user WHERE groupId IN (SELECT groupId FROM x2_group_to_user WHERE userId=' . Yii::app()->user->getId() . '))))'; } else { $condition = ''; } // Optional search parameter for autocomplete $qterm = isset($_GET['term']) ? $_GET['term'] . '%' : ''; $static = isset($_GET['static']) && $_GET['static']; $result = Yii::app()->db->createCommand() ->select('id,name as value') ->from('x2_lists') ->where( ($static ? 'type="static" AND ' : ''). 'modelName="Contacts" AND type!="campaign" AND name LIKE :qterm' . $condition, array(':qterm' => $qterm)) ->order('name ASC') ->queryAll(); echo CJSON::encode($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
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; } }
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 mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) { $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); $this->loadArray($ret); }
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 backup($type='json') { global $DB; global $website; $out = array(); $DB->query('SELECT * FROM nv_templates WHERE website = '.protect($website->id), 'object'); if($type='json') $out = json_encode($DB->result()); return $out; }
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 goingForthAndBackStoresFormValuesOfSecondPageAndTriggersValidationOnlyWhenGoingForward() { $this->browser->request('http://localhost/test/form/simpleform/ThreePageFormWithValidation'); $this->gotoNextFormPage($this->browser->getForm()); $form = $this->browser->getForm(); $form['--three-page-form-with-validation']['text2-1']->setValue('My Text on the second page'); $this->gotoPreviousFormPage($form); $this->gotoNextFormPage($this->browser->getForm()); $r = $this->gotoNextFormPage($this->browser->getForm()); $this->assertSame(' error', $this->browser->getCrawler()->filterXPath('//*[contains(@class,"error")]//input[@id="three-page-form-with-validation-text2-1"]')->attr('class')); $form = $this->browser->getForm(); $form['--three-page-form-with-validation']['text2-1']->setValue('42'); $this->gotoNextFormPage($form); $form = $this->browser->getForm(); $this->assertSame('', $form['--three-page-form-with-validation']['text3-1']->getValue()); }
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
function realCharForNumericEntities($matches) { $newstringnumentity = $matches[1]; if (preg_match('/^x/i', $newstringnumentity)) { $newstringnumentity = hexdec(preg_replace('/^x/i', '', $newstringnumentity)); } // The numeric value we don't want as entities if (($newstringnumentity >= 65 && $newstringnumentity <= 90) || ($newstringnumentity >= 97 && $newstringnumentity <= 122)) { return chr((int) $newstringnumentity); } return '&#'.$matches[1]; }
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 breadcrumb() { global $sectionObj; expHistory::set('viewable', $this->params); $id = $sectionObj->id; $current = null; // Show not only the location of a page in the hierarchy but also the location of a standalone page $current = new section($id); if ($current->parent == -1) { // standalone page $navsections = section::levelTemplate(-1, 0); foreach ($navsections as $section) { if ($section->id == $id) { $current = $section; break; } } } else { $navsections = section::levelTemplate(0, 0); foreach ($navsections as $section) { if ($section->id == $id) { $current = $section; break; } } } assign_to_template(array( 'sections' => $navsections, 'current' => $current, )); }
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 invalidate() { $name = $this->getName(); if (null !== $name) { $params = session_get_cookie_params(); $cookie_options = array ( 'expires' => time() - 42000, 'path' => $params['path'], 'domain' => $params['domain'], 'secure' => $params['secure'], 'httponly' => $params['httponly'], 'samesite' => $params['samesite'] ); $this->removeCookie(); setcookie( session_name(), '', $cookie_options ); } if ($this->isSessionStarted()) { session_unset(); session_destroy(); } $this->started = false; return $this; }
0
PHP
CWE-565
Reliance on Cookies without Validation and Integrity Checking
The application relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.
https://cwe.mitre.org/data/definitions/565.html
vulnerable
function duplicate($options = []) { $input = $this->fields; unset($input['id']); if (is_array($options) && count($options)) { foreach ($options as $key => $val) { if (isset($this->fields[$key])) { $input[$key] = $val; } } } if ($newID = $this->clone($input)) { $this->updateDurationCache($newID); return true; } return false; }
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 closestParentOfType($str) { $str = strtolower($str); $currentEl = $this; while (strtolower($currentEl->getTagName()) != $str && $currentEl->hasParent()) { $currentEl = $currentEl->getParent(); } if (strtolower($currentEl->getTagName()) != $str) { return null; } else { return $currentEl; } }
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
$cache[$key] = array_merge( $fallback_cache[$key], $cache[$key] ); } } else { $cache[$key] = $fallback_cache[$key]; } } } // save to cache for later retrieval $this->cache[$code] = $cache; return; }
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 makeConfig ($file) { $config = "<?php if(!defined('GX_LIB')) die(\"Direct Access Not Allowed!\"); /** * GeniXCMS - Content Management System * * PHP Based Content Management System and Framework * * @package GeniXCMS * @since 0.0.1 build date 20140925 * @version 0.0.1 * @link https://github.com/semplon/GeniXCMS * @author Puguh Wijayanto (www.metalgenix.com) * @copyright 2014-2015 Puguh Wijayanto * @license http://www.opensource.org/licenses/mit-license.php MIT * */error_reporting(0); // DB CONFIG define('DB_HOST', '".Session::val('dbhost')."'); define('DB_NAME', '".Session::val('dbname')."'); define('DB_PASS', '".Session::val('dbpass')."'); define('DB_USER', '".Session::val('dbuser')."'); define('DB_DRIVER', 'mysqli'); define('THEME', 'default'); define('GX_LANG', 'english'); define('SMART_URL', false); //set 'true' if you want use SMART URL (SEO Friendly URL) define('GX_URL_PREFIX', '.html'); // DON't REMOVE or EDIT THIS. define('SECURITY', '".Typo::getToken(200)."'); // for security purpose, will be used for creating password "; try{ $f = fopen($file, "w"); $c = fwrite($f, $config); fclose($f); }catch (Exception $e) { echo $e->getMessage(); } return $config; }
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 _titlegt( $option ) { $where = '('; if ( substr( $option, 0, 2 ) == '=_' ) { if ( $this->parameters->getParameter( 'openreferences' ) ) { $where .= 'pl_title >= ' . $this->DB->addQuotes( substr( $sTitleGE, 2 ) ); } else { $where .= $this->tableNames['page'] . '.page_title >= ' . $this->DB->addQuotes( substr( $option, 2 ) ); } } else { if ( $this->parameters->getParameter( 'openreferences' ) ) { $where .= 'pl_title > ' . $this->DB->addQuotes( $option ); } else { $where .= $this->tableNames['page'] . '.page_title > ' . $this->DB->addQuotes( $option ); } } $where .= ')'; $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
public function delete() { global $db; /* 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']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; // $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; if (empty($this->params['id'])) { flash('error', gt('Missing id for the comment you would like to delete')); expHistory::back(); } // delete the comment $comment = new expComment($this->params['id']); $comment->delete(); // delete the association too $db->delete($comment->attachable_table, 'expcomments_id='.$this->params['id']); // send the user back where they came from. 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 get($key, $default = null) { if ($this !== $result = $this->attributes->get($key, $this)) { return $result; } if ($this !== $result = $this->query->get($key, $this)) { return $result; } if ($this !== $result = $this->request->get($key, $this)) { return $result; } return $default; }
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() { $this->options['alias'] = ''; // alias to replace root dir name $this->options['dirMode'] = 0755; // new dirs mode $this->options['fileMode'] = 0644; // new files mode $this->options['quarantine'] = '.quarantine'; // quarantine folder name - required to check archive (must be hidden) $this->options['rootCssClass'] = 'elfinder-navbar-root-local'; $this->options['followSymLinks'] = true; $this->options['detectDirIcon'] = ''; // file name that is detected as a folder icon e.g. '.diricon.png' $this->options['keepTimestamp'] = array('copy', 'move'); // keep timestamp at inner filesystem allowed 'copy', 'move' and 'upload' $this->options['substituteImg'] = true; // support substitute image with dim command $this->options['statCorrector'] = null; // callable to correct stat data `function(&$stat, $path, $statOwner, $volumeDriveInstance){}` }
0
PHP
CWE-918
Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
https://cwe.mitre.org/data/definitions/918.html
vulnerable
public function getModel() { return $this->model; }
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 __construct($config = null) { $this->config = HTMLPurifier_Config::create($config); $this->strategy = new HTMLPurifier_Strategy_Core(); }
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 login($redirectCallback = null) { $aConf = $GLOBALS['_MAX']['CONF']; if (!is_callable($redirectCallback)) { // Set the default callback $redirectCallback = array('OA_Auth', 'checkRedirect'); } if (call_user_func($redirectCallback)) { header('location: http://'.$aConf['webpath']['admin']); exit(); } if (defined('OA_SKIP_LOGIN')) { return OA_Auth::getFakeSessionData(); } if (OA_Auth::suppliedCredentials()) { $doUser = OA_Auth::authenticateUser(); if (!$doUser) { sleep(3); OA_Auth::restart($GLOBALS['strUsernameOrPasswordWrong']); } return OA_Auth::getSessionData($doUser); } OA_Auth::restart(); }
0
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
vulnerable
public static function parseAndTrim($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); // global $db; $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = str_replace("�", "-", $str); $str = str_replace("�", "&#151;", $str); $str = str_replace("�", "&rdquo;", $str); $str = str_replace("�", "&ldquo;", $str); $str = str_replace("\r\n", " ", $str); //$str = str_replace(",","\,",$str); $str = str_replace('\"', "&quot;", $str); $str = str_replace('"', "&quot;", $str); $str = str_replace("�", "&#188;", $str); $str = str_replace("�", "&#189;", $str); $str = str_replace("�", "&#190;", $str); //$str = htmlspecialchars($str); //$str = utf8_encode($str); // if (DB_ENGINE=='mysqli') { // $str = @mysqli_real_escape_string($db->connection,trim(str_replace("�", "&trade;", $str))); // } elseif(DB_ENGINE=='mysql') { // $str = @mysql_real_escape_string(trim(str_replace("�", "&trade;", $str)),$db->connection); // } else { // $str = trim(str_replace("�", "&trade;", $str)); // } $str = @expString::escape(trim(str_replace("�", "&trade;", $str))); //echo "2<br>"; eDebug($str,die); return $str; }
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 save_comment( $comment_id = 0, $approval = '' ) { if ( !$comment_id || 'spam' === $approval || empty( $_POST['comment_location'] ) || !is_array( $_POST['comment_location'] ) ) { return false; } GeoMashupDB::set_object_location( 'comment', $comment_id, $_POST['comment_location'] ); }
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 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-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 activate_discount(){ if (isset($this->params['id'])) { $discount = new discounts($this->params['id']); $discount->update($this->params); //if ($discount->discountulator->hasConfig() && empty($discount->config)) { //flash('messages', $discount->discountulator->name().' requires configuration. Please do so now.'); //redirect_to(array('controller'=>'billing', 'action'=>'configure', 'id'=>$discount->id)); //} } expHistory::back(); }
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
function configure() { expHistory::set('editable', $this->params); // little bit of trickery so that that categories can have their own configs $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; $pullable_modules = expModules::listInstalledControllers($this->baseclassname, $this->loc); $views = expTemplate::get_config_templates($this, $this->loc); $gc = new geoCountry(); $countries = $gc->find('all'); $gr = new geoRegion(); $regions = $gr->find('all'); assign_to_template(array( 'config'=>$this->config, 'pullable_modules'=>$pullable_modules, 'views'=>$views, 'countries'=>$countries, 'regions'=>$regions, 'title'=>static::displayname() )); }
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 getPurchaseOrderByJSON() { 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'); } echo json_encode($purchase_orders); }
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
$resp = $this->asEditor()->get($entity->getUrl('/export/html')); $resp->assertDontSee('window.donkey'); $resp->assertDontSee('script'); $resp->assertSee('.my-test-class { color: red; }'); }
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
foreach($row as $key => $value) { $type = gettype($value); $sqltype=NULL; switch($type) { case "integer": $sqltype = SQLITE3_INTEGER; break; case "string": $sqltype = SQLITE3_TEXT; break; case "NULL": $sqltype = SQLITE3_NULL; break; default: $sqltype = "UNK"; } $stmt->bindValue(":".$key, $value, $sqltype); }
0
PHP
CWE-862
Missing Authorization
The software does not perform an authorization check when an actor attempts to access a resource or perform an action.
https://cwe.mitre.org/data/definitions/862.html
vulnerable
public function confirm() { $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); $this->response->html($this->template->render('project_tag/remove', array( 'tag' => $tag, 'project' => $project, ))); }
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 hasHeader($header) { return isset($this->headerNames[strtolower($header)]); }
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 approve_toggle() { if (empty($this->params['id'])) return; /* 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']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login']; // $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval']; // $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification']; // $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email']; $comment = new expComment($this->params['id']); $comment->approved = $comment->approved == 1 ? 0 : 1; if ($comment->approved) { $this->sendApprovalNotification($comment,$this->params); } $comment->save(); 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
$this->AddValidationError($prop, "$prop exceeds the maximum length of " . $fm->FieldSize . ""); } if ($this->$prop == "" && ($fm->DefaultValue || $fm->IsAutoInsert)) { // these fields are auto-populated so we don't need to validate them unless // a specific value was provided } else { switch ($fm->FieldType) { case FM_TYPE_INT: case FM_TYPE_SMALLINT: case FM_TYPE_TINYINT: case FM_TYPE_MEDIUMINT: case FM_TYPE_BIGINT: case FM_TYPE_DECIMAL: if (! is_numeric($this->$prop)) { $this->AddValidationError($prop, "$prop is not a valid number"); } break; case FM_TYPE_DATE: case FM_TYPE_DATETIME: if (strtotime(($this->$prop ?? '')) === '') { $this->AddValidationError($prop, "$prop is not a valid date/time value."); } break; case FM_TYPE_ENUM: if (! in_array($this->$prop, $fm->GetEnumValues())) { $this->AddValidationError($prop, "$prop is not valid value. Allowed values: " . implode(', ', $fm->GetEnumValues())); } break; default: break; } } }
1
PHP
NVD-CWE-Other
Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
https://nvd.nist.gov/vuln/categories
safe
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
function __construct($uid, $folder = null, $is_safe = false) { // decode combined UID-folder identifier if (preg_match('/^\d+-.+/', $uid)) { list($uid, $folder) = explode('-', $uid, 2); } $this->uid = $uid; $this->app = rcube::get_instance(); $this->storage = $this->app->get_storage(); $this->folder = strlen($folder) ? $folder : $this->storage->get_folder(); // Set current folder $this->storage->set_folder($this->folder); $this->storage->set_options(array('all_headers' => true)); $this->headers = $this->storage->get_message($uid); if (!$this->headers) { return; } $this->mime = new rcube_mime($this->headers->charset); $this->subject = $this->headers->get('subject'); list(, $this->sender) = each($this->mime->decode_address_list($this->headers->from, 1)); $this->set_safe($is_safe || $_SESSION['safe_messages'][$this->folder.':'.$uid]); $this->opt = array( 'safe' => $this->is_safe, 'prefer_html' => $this->app->config->get('prefer_html'), 'get_url' => $this->app->url(array( 'action' => 'get', 'mbox' => $this->folder, 'uid' => $uid), false, false, true) ); if (!empty($this->headers->structure)) { $this->get_mime_numbers($this->headers->structure); $this->parse_structure($this->headers->structure); } else { $this->body = $this->storage->get_body($uid); } // notify plugins and let them analyze this structured message object $this->app->plugins->exec_hook('message_load', array('object' => $this)); }
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
public function confirm() { $task = $this->getTask(); $link = $this->getTaskLink(); $this->response->html($this->template->render('task_internal_link/remove', array( 'link' => $link, 'task' => $task, ))); }
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 __construct($selector = false) { $this->selector = $selector; }
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($id, $label, $extra) { $ret = $this->get($id); if (!$ret) { /* get() already logged and set $this->error. */ return self::ID_NOT_EXITS; } $class = get_class($this); try { $oldlabel = $ret->{$this->flabel}; $this->zdb->connection->beginTransaction(); $values = array( $this->flabel => $label, $this->fthird => $extra ); $update = $this->zdb->update($this->table); $update->set($values); $update->where($this->fpk . ' = ' . $id); $ret = $this->zdb->execute($update); if ($oldlabel != $label) { $this->deleteTranslation($oldlabel); $this->addTranslation($label); } Analog::log( $this->getType() . ' #' . $id . ' updated successfully.', Analog::INFO ); $this->zdb->connection->commit(); return true; } catch (Throwable $e) { $this->zdb->connection->rollBack(); Analog::log( 'Unable to update ' . $this->getType() . ' #' . $id . ' | ' . $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
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; } }
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
foreach($image->expTag as $tag) { if (isset($used_tags[$tag->id])) { $used_tags[$tag->id]->count++; } else { $exptag = new expTag($tag->id); $used_tags[$tag->id] = $exptag; $used_tags[$tag->id]->count = 1; } }
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 mb_strlen($s, $encoding = null) { $encoding = self::getEncoding($encoding); return iconv_strlen($s, $encoding); }
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 disable() { $this->checkCSRFParam(); $project = $this->getProject(); $swimlane_id = $this->request->getIntegerParam('swimlane_id'); if ($this->swimlaneModel->disable($project['id'], $swimlane_id)) { $this->flash->success(t('Swimlane updated successfully.')); } else { $this->flash->failure(t('Unable to update this swimlane.')); } $this->response->redirect($this->helper->url->to('SwimlaneController', '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
public function confirm() { $project = $this->getProject(); $category = $this->getCategory(); $this->response->html($this->helper->layout->project('category/remove', array( 'project' => $project, 'category' => $category, ))); }
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 main() { $a = array(); $a['g'] = &$a; test($a); test($GLOBALS); }
1
PHP
NVD-CWE-Other
Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
https://nvd.nist.gov/vuln/categories
safe