Description
The Security Team noticed that the termination condition of the for loop in the readExternal method is a controllable variable, which, if tampered with, may lead to CPU exhaustion. As a fix, we added an upper bound and termination condition in the read and write logic. We classify it as a "low-priority but useful improvement". SystemDS is a distributed system and needs to serialize/deserialize data but in many code paths (e.g., on Spark broadcast/shuffle or writing to sequence files) the byte stream is anyway protected by additional CRC fingerprints. In this particular case though, the number of decoders is upper-bounded by twice the number of columns, which means an attacker would need to modify two entries in the byte stream in a consistent manner. By adding these checks robustness was strictly improved with almost zero overhead. These code changes are available in versions higher than 2.2.1.
Remediation
References
https://lists.apache.org/thread/r4x2d2r6d4zykdrrx6s2l4qbxgzws0z3
https://security.netapp.com/advisory/ntap-20220812-0003/
Related Vulnerabilities
CVE-2021-21350 Vulnerability in maven package com.thoughtworks.xstream:xstream
CVE-2021-31404 Vulnerability in maven package com.vaadin:flow-server
CVE-2022-27166 Vulnerability in maven package org.apache.jspwiki:jspwiki-main
CVE-2022-23647 Vulnerability in npm package prismjs
CVE-2022-46769 Vulnerability in maven package org.apache.sling:org.apache.sling.cms.ui