Skip to content
RCE Disclosed report Intermediate

CSV export filter bypass leads to formula injection.

edoverflow Follow

Originally disclosed on HackerOne

Medium 5.4 View original
  • 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.

Python
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:

Python
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:

Python
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

The original report as published on HackerOne, by edoverflow. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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.

More by edoverflow

View all

27 more disclosed reports, best first.

More from Weblate

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.