EMC Secure Remote Services Virtual Edition Provisioning component is affected by SQL injection

Abstract

An SQL injection vulnerability was found in EMC Secure Remote Services Virtual Edition (ESRS VE) that allows an attacker to retrieve arbitrary data from the application, interfere with its logic, or execute commands on the database server itself.

Affected versions

EMC reports that the following versions are affected by this vulnerability:

  • EMC Secure Remote Services Virtual Edition 3.02
  • EMC Secure Remote Services Virtual Edition 3.03

See also

Fix

EMC released EMC Secure Remote Services Virtual Edition 3.04 that resolves this vulnerability. Registered EMC Online Support customers can download patches and software from support.emc.com at:

EMC Secure Remote Services -> EMC Secure Remote Services Virtual Edition -> Downloads

Introduction

An SQL injection vulnerability was found in EMC Secure Remote Services Virtual Edition (ESRS VE) that allows an attacker to retrieve arbitrary data from the application, interfere with its logic, or execute commands on the database server itself.

Details

In general, SQL statements in ESRS' Provisioning classes are created in a secure way by using prepared statements. An instance was found where an SQL statement is created insecurely using string concatenation. This can result in SQL injection, because it can contain tainted input received from the ESRS portal (provisioningStatus, ProvisioningResponse).

This vulnerability enables an attacker to retrieve arbitrary data from the application, interfere with its logic, or execute commands on the database server itself.

com/emc/esrs/provisioning/dao/ProvisioningDaoImpl.java:

provisioningStatus.setStatus(Integer.valueOf(1));
provisioningStatus.setSerialNumber(serialno);
this.provisioningDao.update(provisioningStatus);

public boolean update(ProvisioningStatus **status**){
	Connection conn = null;
	Statement stmt = null;
	try {
		conn = getConnection();
		if (conn != null) {
			stmt = conn.createStatement();
			int count = 0;

			StringBuilder sql = new StringBuilder("");
			sql.append("update \"public\".\"provisioningstatus\" set ");

			if (status.getStatus() != null) {
				sql.append("status =" + status.getStatus());
				count++;
			}
			if (status.getSerialNumber() != null) {
				if (count == 0)
					sql.append("serialnumber = '" + **status.getSerialNumber()** + "'");
				else {
					sql.append(", serialnumber =' " + **status.getSerialNumber()** + "'");
				}
				count++;
			}
			if (status.getSiteID() != null) {
				if (count == 0)
					sql.append("siteid = " + **status.getSiteID()**);
				else {
					sql.append(", siteid = " + **status.getSiteID()**);
			}
			count++;
		}
		if (status.getUserName() != null) {
			if (count == 0)
				sql.append("username = '" + status.getUserName() + "'");
		}
		sql.append(" where pvsid='" + status.getProvisioningStatusID() + "'");
		sql.append(" and  operation='" + status.getOperation() + "'");
		this.logger.debug("SQl query:" + sql.toString());

		int result = **stmt.executeUpdate(sql.toString())**;
		this.logger.debug("Result of Update:" + result);
		conn.close();
	}

Questions or feedback?