CSV export filter bypass leads to formula injection.
Originally disclosed on HackerOne
- Triaged in 5 hours
- Fixed in 6 hours
- Disclosed after 21 days
Dear Weblate bug bounty team,
Summary
The new filter can be bypassed using: %0A-3+3+cmd|' /C calc'!D2.
text = "%0A-3+3+cmd|' /C calc'!D2"
def csv_filter_bypass():
if text and text[0] in ('=', '+', '-', '@'):
return "'" + text
return text
How can this be fixed?
You need to escape and detect more characters as follows:
text = "%0A-3+3+cmd|' /C calc'!D2"
def csv_filter_fix():
if text and text[0] in ('=', '+', '-', '@', '|', '%'):
text = text.replace("|", "\|")
return "'" + text + "'"
return text
You can compare your results with the following demonstration:
text = "%0A-3+3+cmd|' /C calc'!D2"
def csv_filter_bypass():
if text and text[0] in ('=', '+', '-', '@'):
return "'" + text
return text
def csv_filter_fix():
if text and text[0] in ('=', '+', '-', '@', '|', '%'):
text = text.replace("|", "\|")
return "'" + text + "'"
return text
csv_filter_bypass()
csv_filter_fix()
Best regards, Ed
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity RCE bug in Weblate, rated CVSS 5.4. HackerOne made it public on 17 May 2017.
About RCE
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.