Security researchers have uncovered a new sophisticated serverless computing attack vector. This vulnerability dubbed “function confusion” allows threat actors to execute malicious commands. It specifically exploits services offered by Google Cloud Platform and also other providers. Attackers can leverage package installation scripts that are used within various cloud functions. This method enables them to gather sensitive system information from compromised cloud environments. They can also potentially establish persistence or even escalate their privileges. This attack method poses a very significant risk to many modern cloud users. It often bypasses traditional security controls by operating within legitimate cloud infrastructure.
The attack effectively capitalizes on automated package installation procedures used in cloud functions. These procedures commonly occur when new cloud functions are deployed or get updated. Attackers craft specially designed Node.js packages containing malicious code embedded in installation scripts. This then triggers the execution of arbitrary commands that extract valuable system information. Exfiltrated data is subsequently sent by attackers to their remote command and control servers. Cisco Talos security researchers recently identified this emerging and quite dangerous new threat. Their detailed analysis revealed specific command patterns and also unique data exfiltration techniques. This exploitation technique not only affects Google Cloud Platform but also other providers. It extends to AWS Lambda and Azure Functions showing widespread method applicability.
Attackers often use this method primarily to perform detailed reconnaissance on compromised systems.
They actively gather operating system details and also sensitive user account information. Network configurations and other sensitive data are collected from these cloud environments. This all occurs largely undetected by most conventional security system monitoring tools. The attack uses a deceptively simple but highly effective technical exploitation technique. Malicious commands are embedded by attackers in the “preinstall” script of a package.json file. When cloud functions install dependencies these commands execute automatically with significant system privileges. One observed example shows attackers using a package named “myconfusedfunctionpoctestpackage” for these attacks.
Numerous variations of malicious package.json files were documented each extracting different system data.
This attack’s ability to operate across multiple major cloud environments is particularly concerning. Researchers confirmed similar techniques work in AWS Lambda and also in Azure Functions. This proves it is a fundamental weakness in how cloud functions handle installations. Server logs show successful exfiltration of sensitive data from various Linux distributions. As organizations increasingly migrate to serverless architectures this represents an evolving serious threat. Security teams must therefore address this specific attack vector through enhanced security measures. This includes enhanced monitoring of all package installations during cloud function deployments. Restricting external network connections during function deployment processes can also greatly help. Careful scrutiny of all third-party dependencies incorporated into cloud functions is crucial.
Reference: