Security risks with higher level languages in middleware products

Java-based high-level application-specific languages provide significant flexibility when using middleware products such as BRMS. This flexibility comes at a price as there are significant security concerns in their use. In this article the usage of Drools language and MVEL in JBoss BRMS is looked at to demonstrate some of these concerns. Other middleware products might be exposed to similar risks.

Java is an extremely feature-rich portable language that is used to build a great range of software products, from desktop GUI applications to smartphone apps to dedicated UIs for hardware such as printers to a breadth of server-side products, mostly middleware. As such, Java is a general-purpose language with a rather steep learning curve and strict syntax, well suited for complex software projects but not very friendly for writing simple scripts and one-liner pieces of code.

Several efforts emerged over time to introduce Java-based or Java-like scripting functionality, with probably the most famous one being Javascript: a language that is not based on Java but appearing similar to Java in several aspects; and it is well-suited for scripting.

Another example of a simplified language based on Java is MVEL. MVEL is an expression language, mostly used for making basic logic available in application-specific languages and configuration files, such as XML. It’s not intended for some serious object-oriented programming, but mainly simple expressions as in “user.getManager().getName() != null”. However simple, MVEL is still very powerful and allows the use of any Java APIs available to the developer; its strength is its simplified syntax which doesn’t restrict the ability to call any code the developer may need access to.

Yet another example of a Java-based application-specific language is the Drools rules language. It is used in JBoss BRMS, a middleware product that implements Business Rules, and its open source counterpart Drools. There is a similar idea behind the Drools language: to hide all the clutter of Java from the rules developer and provide a framework that makes it easy to concentrate on the task at hand (namely: writing business rules) without compromising the ability to call any custom Java code that might be needed to properly implement the organisation’s business logic.

Developers of Java middleware products, starting with application servers and continuing to more complex application frameworks, traditionally invest a great deal of effort into making their products secure. This includes: separating the product’s functionality into several areas with different levels of risk; applying user roles to each of these areas; authorization and authentication of users; audit of the available functionality to evaluate the risk of using this functionality for unintended tasks that could potentially lead to compromises, etc. In this context it is important to understand that the same rich feature set and versatility that makes Java so attractive as a developer platform also becomes its Achilles heel when it comes to security: every so often one of these features finds its way into some method of unintended use or another.

In this article I will look at one such case where a very flexible feature was added to one of the middleware products that was later discovered to include unsafe consequences, and the methods used to patch it.

JBoss BRMS, mentioned above, had a role-based security model from the very beginning. Certain roles would allow deployment of new rules and certain development processes would normally be established to allow proper code review prior to deployment. These combined together would ensure that only safe code is ever deployed on the server.

This changed in BRMS (and BPMS) 6. A new WYSIWYG tool was introduced that allowed for constructing the rules graphically in a browser session, and testing them right away. So any person with rule authoring permissions (role known as “analyst” rather than “admin”) would be able to do this. The Drools rules would allow writing arbitrary MVEL expressions, that in turn allow any calls to any Java classes deployed on the application server without restrictions, including the system ones. As an example, an analyst would be able to write System.exit() in a rule and testing this rule would shut down the server. Basically, the graphical rule editor allowed authenticated arbitrary code execution for non-admin users.

A similar problem existed in JBoss Fuse Service Works 6. While the Drools engine that ships with it does not come with any graphical tool to author rules, so the rules must be deployed on the server as before, it comes with the RTGov component that has some MVEL interfaces exposed. Sending an RTGov request with an MVEL expression in it would again allow authenticated arbitrary code execution for any user that has RTGov permissions.

This behaviour was caught early on in the development cycle for BxMS/FSW version 6, and a fix was implemented. The fix involves running the application server with Java Security Manager (JSM) turned on, and enabling specific security policies for user-provided code. After the fix was applied, only a limited number of Java instructions were allowed to be used inside user-provided expressions, which were safe for use in legitimate Drools rules and RTGov interfaces, and the specific RCE (Remote Code Execution) vulnerability was considered solved. Essentially a similar security approach was taken as for running Java applets in a sandbox within a browser, where an applet can only use a safe subset of the Java library.

Some side-effects were detected when products went into testing with the fix applied and performance regression was executed. It was discovered that certain tests ran significantly slower with JSM enabled than on an unsecured machine. This slowdown was significant only in those tests that took into account only the raw performance of rules, not “real-world” scenarios, since any kind of database access would slow down the overall performance anyway, much more significantly than enabling the JSM. However, certain guidelines were developed in order to help customers achieve the best possible balance of speed and security.

When deploying BRMS/BPMS on a high-performance production server, it is possible to disable JSM, but at the same time not to allow any “analyst”-role users to use these systems for rule development. It is recommended to use these servers for running the rules and applications developed separately and achieving maximum performance, while eliminating the vulnerability by disabling the whole attack vector by disallowing the rule development altogether.

When BRMS is deployed on development servers used by rule developers and analysts, it is suggested to run these servers with JSM enabled. Since these are not production servers, they do not require mission critical performance in processing real-time customer data, as they are only used for application and rule development. As such, the overhead of the JSM is not noticeable on a non mission-critical server and it is a fair trade-off for a tighter security model.

When a server is deployed in a “BRMS-as-a-service” configuration, or in other words when rule development is exposed to customers over the Web (even through a VPN-protected Extranet), enabling the complete JSM protection is the recommended approach, accepting the JSM overhead. Without it, any customer with minimal “rule writing and testing” privileges can completely take over the server (and any other co-hosted customers’ data as well), a very undesirable situation to avoid.

Similar solutions are recommended for FSW. Since only RTGov exposes the weakness, it is recommended to run RTGov as a separate server with JSM enabled. For high performance production servers, it is recommended not to install or enable the RTGov component, which eliminates the risk of exposure of user-provided code-based attack vectors, making it possible to run them without JSM at full speed.

This kind of concern is not specific to JBoss products but is a generic problem potentially affecting any middleware system. Any time rich functionality is made available to users, some of it may be used for malicious purpose. Red Hat takes security of the customers very seriously and every effort is made not only to provide the customers with the richest functionality, but also making sure this functionality is safe to use and proper safe usage guidelines are available.

Product

Red Hat JBoss BPM Suite

Tags

drools java security

HTTPS Only 3.1 (Detailed Analysis, Browser Security, Open Source, Python)

Posted by David Leo on Mar 23

To secure browser which is very fragile, the approach of HTTPS Only 3.1 is exceptionally simple:
1. Only HTTPS URLs(no other protocols)
2. Whitelist of domains(anything outside of whitelist is blocked)

Now, let’s look at threats:
1. Man in the middle – it’s fixed.
2. Phishing always requires the browser to load attacker’s website, so it’s permanently dead here.
3. Drive-by Download – dead(if applied strictly, unable to…

Facebook Messenger (iOS) Certificate Validation Vulnerability

Posted by Sean Wright on Mar 23

Classification: //Dell SecureWorks/Public Use:

Classification: //Dell SecureWorks/Public Use:

Advisory Information
=================
Title: Facebook Messenger (iOS) Certificate Validation Vulnerability
Advisory ID: SWRX-2016-001
Advisory URL: https://www.secureworks.com/research/swrx-2016-001
Date published: Tuesday, March 22, 2016
CVE: Not assigned
CVSS v2 base score: 5.8
Date of last update: Tuesday, March 22, 2016
Vendors contacted:…

Executable installers are vulnerable^WEVIL (case 32): Comodo's installers allow arbitrary (remote) code execution WITH escalation of privilege

Posted by Stefan Kanthak on Mar 23

Hi @ll,

the executable installers cispro_30day_installer_1150_8d.exe,
cispremium_installer_6100_08.exe, cav_installer_5951_60.exe,
cav_installer.exe and cfw_installer.exe available from
<http://www.comodo.com> load and execute several DLLs from
their “application directory”.

For software downloaded with a web browser the application
directory is typically the user’s “Downloads” directory: see
<…

CESA-2016:0494 Moderate CentOS 6 kernel SecurityUpdate

CentOS Errata and Security Advisory 2016:0494 Moderate

Upstream details at : https://rhn.redhat.com/errata/RHSA-2016-0494.html

The following updated files have been uploaded and are currently 
syncing to the mirrors: ( sha256sum Filename ) 

i386:
017fef95ff3500570ac154d6f45fdc65647e3b4de5652553166a3e3edb331435  kernel-2.6.32-573.22.1.el6.i686.rpm
4483aa600ec1c1f105b1e45980835881e950b683e06458ae497021c91204c2fc  kernel-abi-whitelists-2.6.32-573.22.1.el6.noarch.rpm
714807a6369064aa725de1d945f434e4bb12906c1684aa4ba155ae47bcc99075  kernel-debug-2.6.32-573.22.1.el6.i686.rpm
5bef167c0e655bd35c36a4695bcaf6c3fc18f500f18b9920da9dacdc86138647  kernel-debug-devel-2.6.32-573.22.1.el6.i686.rpm
5b0397b95e8bf0c5215c5477a932bf53ae6325c99a43f671f24e6d27db2828dd  kernel-devel-2.6.32-573.22.1.el6.i686.rpm
8e7f84b2fec3ff4a8fe050494b9a1bb7c85d0da371cb5702849ba7329722fb4c  kernel-doc-2.6.32-573.22.1.el6.noarch.rpm
bca504a4e5ce58b5bfceeccedb8c80a29a5e8a59e8816bbadec51e819cf4f7d2  kernel-firmware-2.6.32-573.22.1.el6.noarch.rpm
1d8bd830eb8ecfffefc0fb965909ef658cda6e8520646d3786bc924a4b3016b1  kernel-headers-2.6.32-573.22.1.el6.i686.rpm
0e6d7600436836674be8ea1dc8f0f0e4fbd4335a43d4c116f79019103df2f644  perf-2.6.32-573.22.1.el6.i686.rpm
f76f572c24bbdf124e943183ac3d5527a43bf50ea5d7e9804c1ba7965805c86f  python-perf-2.6.32-573.22.1.el6.i686.rpm

x86_64:
ed27297a1d0d1c622e13e6dd5776be6e57e49f26a3970896403aa033a3e44a18  kernel-2.6.32-573.22.1.el6.x86_64.rpm
4483aa600ec1c1f105b1e45980835881e950b683e06458ae497021c91204c2fc  kernel-abi-whitelists-2.6.32-573.22.1.el6.noarch.rpm
26dea12181fd0a7ed1ce63f5411859bcdd23013abbf6ae5e382a3dda547a8ce6  kernel-debug-2.6.32-573.22.1.el6.x86_64.rpm
5bef167c0e655bd35c36a4695bcaf6c3fc18f500f18b9920da9dacdc86138647  kernel-debug-devel-2.6.32-573.22.1.el6.i686.rpm
c6181146fc54e88a039e52129e5a87da39d69d60baa1d9e4ff488a4e9824148f  kernel-debug-devel-2.6.32-573.22.1.el6.x86_64.rpm
ce8cb773ef1d920226ca21357a99e5047189a10818c4e534668963d3b0c5b45b  kernel-devel-2.6.32-573.22.1.el6.x86_64.rpm
8e7f84b2fec3ff4a8fe050494b9a1bb7c85d0da371cb5702849ba7329722fb4c  kernel-doc-2.6.32-573.22.1.el6.noarch.rpm
bca504a4e5ce58b5bfceeccedb8c80a29a5e8a59e8816bbadec51e819cf4f7d2  kernel-firmware-2.6.32-573.22.1.el6.noarch.rpm
1576e4fc10350ec5027eb0ec9b8f8201dda72393bbd3bc1dd0b2514b781fee29  kernel-headers-2.6.32-573.22.1.el6.x86_64.rpm
a602b2d9616c86028ab1994981371415ac93321942245f8b9cb72ec127a3f567  perf-2.6.32-573.22.1.el6.x86_64.rpm
0d9f73e09d92777adefe895e44988e2fe377654d7b55f4822fd845c220121635  python-perf-2.6.32-573.22.1.el6.x86_64.rpm

Source:
c773bc6fb5f553a200efc0f4ddd2c36ec5ae6879bee3707ab2c1939fae7781bf  kernel-2.6.32-573.22.1.el6.src.rpm



CESA-2016:0491 Moderate CentOS 6 foomaticSecurity Update

CentOS Errata and Security Advisory 2016:0491 Moderate

Upstream details at : https://rhn.redhat.com/errata/RHSA-2016-0491.html

The following updated files have been uploaded and are currently 
syncing to the mirrors: ( sha256sum Filename ) 

i386:
652afc2fd59b5d0187fe7e2ec3ff00928c682cf02c260f63c8ddcc766bc5751d  foomatic-4.0.4-5.el6_7.i686.rpm

x86_64:
0b32efaf477b4fc9c4b0712c066fe82b3849c9d3ad9ca8573e818f74f7fbe22c  foomatic-4.0.4-5.el6_7.x86_64.rpm

Source:
8a56c8a1405e6ec01999d5842929b22a6678c65dee130d84bb1a8ca89dee4bb2  foomatic-4.0.4-5.el6_7.src.rpm



CESA-2016:0493 Moderate CentOS 6 krb5 SecurityUpdate

CentOS Errata and Security Advisory 2016:0493 Moderate

Upstream details at : https://rhn.redhat.com/errata/RHSA-2016-0493.html

The following updated files have been uploaded and are currently 
syncing to the mirrors: ( sha256sum Filename ) 

i386:
7d8bb7f093e34e23784d932fa81189657342447f31ae1b8d5db6ac6e03b1baf3  krb5-devel-1.10.3-42z1.el6_7.i686.rpm
d558d908cecd66ad67532f09fe8646d8878fb1b9f22840f8ed8f98ddd1ddad41  krb5-libs-1.10.3-42z1.el6_7.i686.rpm
c404d2a65af89a8f51260589fb5e0681fd4f0919eb1ea97acb0bc63f221efc84  krb5-pkinit-openssl-1.10.3-42z1.el6_7.i686.rpm
790c2fd8cb816a96dc622ba1400cc1d4f29a332254ffd3119627c41598f2b041  krb5-server-1.10.3-42z1.el6_7.i686.rpm
4f391dcd77d5d46d0033edafb9467f52c3ac52e2e3cd0d9a6342344041b55756  krb5-server-ldap-1.10.3-42z1.el6_7.i686.rpm
90e91a1a14ced48e6cdabf928aedae364f26c181f9028c8fde89e8fdd7c3ef8d  krb5-workstation-1.10.3-42z1.el6_7.i686.rpm

x86_64:
7d8bb7f093e34e23784d932fa81189657342447f31ae1b8d5db6ac6e03b1baf3  krb5-devel-1.10.3-42z1.el6_7.i686.rpm
bcde64ca4bbc78832a5cd879b83d68a39b48c8e33ebc049b035d566d1957a785  krb5-devel-1.10.3-42z1.el6_7.x86_64.rpm
d558d908cecd66ad67532f09fe8646d8878fb1b9f22840f8ed8f98ddd1ddad41  krb5-libs-1.10.3-42z1.el6_7.i686.rpm
472a3f28b11a9da71dabe79127ffb887db8d2d732634e7488e9ab649b59671dc  krb5-libs-1.10.3-42z1.el6_7.x86_64.rpm
1aaafd87517652bea5156d56288ac325234ccd231cac4eb1ab9c81f2b84f5ee3  krb5-pkinit-openssl-1.10.3-42z1.el6_7.x86_64.rpm
f286a8956b6a9c3d8e7cd8f166f34de1709160eb6ef06a3bca9217ba5c786369  krb5-server-1.10.3-42z1.el6_7.x86_64.rpm
4f391dcd77d5d46d0033edafb9467f52c3ac52e2e3cd0d9a6342344041b55756  krb5-server-ldap-1.10.3-42z1.el6_7.i686.rpm
f30b05dd938714a3aeb4a380ce457d3c3355203b3e5649d86714765117f14813  krb5-server-ldap-1.10.3-42z1.el6_7.x86_64.rpm
01140cad02a03ba23aeca839b8f425a9effb1b755fb8c3714330765b7a941973  krb5-workstation-1.10.3-42z1.el6_7.x86_64.rpm

Source:
bac4ff36ebcbb21a49ac22999b672c6a1a49a2c6efb6abf8193316f557396c23  krb5-1.10.3-42z1.el6_7.src.rpm