SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Remote Shell Upload Vulnerability

Open HenryHoggard opened this issue 13 years ago • 20 comments

There is potential for remote shell upload vulnerability in avatar upload if certain settings are met.

REMOVED (see comments)

This was tested on SMF 2.0.5 File Affected

REMOVED (see comments)

HenryHoggard avatar Oct 10 '13 09:10 HenryHoggard

There is a test a bit later on which make sure the uploaded stuff is an image through a getimagesize call, indeed the file is not deleted on error, but this should be handled by PHP at the end of the script execution.

butch2k avatar Oct 10 '13 11:10 butch2k

btw is there a reason behind using rename() rather than move_uploaded_file() to move the uploaded file ?

butch2k avatar Oct 10 '13 11:10 butch2k

@butch2k It's not safe to trust rename() in that situation anyway. But fortunately if you look at the code you'll see that's not actually what it's doing. It pulls the file from system temp or wherever into the attachments folder, and THEN renames it after.

@HenryHoggard Thank you for your report. It is so nice to have a public vulnerability report where EVERYONE can see it and now exploit it. It would have been nicer still if you'd reported it to us privately (there are options on simplemachines.org for doing such a private report) and given us an opportunity to get a patch out on it before a public disclosure.

We are working on this issue.

Arantor avatar Oct 10 '13 17:10 Arantor

@Arantor There was no contact us page that I could see.

HenryHoggard avatar Oct 11 '13 13:10 HenryHoggard

Yeah, it's not particularly obvious - but it does exist - http://www.simplemachines.org/about/smf/security.php

Please edit your report to remove the details, because having this publicly visible before a patch is public doesn't help anyone except the miscreants.

Arantor avatar Oct 11 '13 13:10 Arantor

Deleted all details, hope you noted it down!

HenryHoggard avatar Oct 11 '13 13:10 HenryHoggard

Thanks :)

Yes, we have all the details and a patch is in testing at present for it.

Arantor avatar Oct 11 '13 13:10 Arantor

Thank you for your report. It is so nice to have a public vulnerability report where EVERYONE can see it and now exploit it. It would have been nicer still if you'd reported it to us privately (there are options on simplemachines.org for doing such a private report) and given us an opportunity to get a patch out on it before a public disclosure.

Yes its much better that it is contained to just the hacking forums ... not like anyone on those sites would put it to use ... Instead of bitching about it why not send out a security alert and tell users what they could do while the patch is in the works.

deliciousbamboo avatar Oct 13 '13 22:10 deliciousbamboo

That's kind of the point: there's not really a lot that users can do about this vulnerability without a patch, short of disabling functions that almost every forum uses.

I don't know whether you're a regular SMF user or have some reason to bitch about the way we do things, but please contain your bile in future, thanks.

Arantor avatar Oct 13 '13 23:10 Arantor

I don't know whether you're a regular SMF user or have some reason to bitch about the way we do things, but please contain your bile in future, thanks.

Yea sure thing, it was based of your bashing of the other guy for posting a bug

could not they disable uploads while the patch is pending? Don't know just "trolling" the code now

deliciousbamboo avatar Oct 14 '13 00:10 deliciousbamboo

No, my attitude was because it's one thing to publicly disclose a vulnerability, it's another thing entirely to have told us privately first so we could take a look at it. We have a patch in testing for this issue.

Disabling uploads of both attachments and avatars? Not particularly recommended. Especially as by the time a decent number of sites had done it, we would already have a patch out.

Arantor avatar Oct 14 '13 00:10 Arantor

but it is something they could do yes, to protect them?

deliciousbamboo avatar Oct 14 '13 00:10 deliciousbamboo

Yes, if we got the message out - not that most of our users would listen - and by the time it had got to them, we'd have a patch out.

Arantor avatar Oct 14 '13 00:10 Arantor

ok thanks

deliciousbamboo avatar Oct 14 '13 00:10 deliciousbamboo

Any news on expected release time for a patch?

HenryHoggard avatar Oct 17 '13 09:10 HenryHoggard

It's still in testing. As you can imagine this is not a simple matter to deal with and has consequences for all 3 branches of SMF that are active.

Arantor avatar Oct 17 '13 16:10 Arantor

The 2.0 patch is in final testing, the 2.1 repository will be updated once it is complete and finalised.

Arantor avatar Oct 19 '13 02:10 Arantor

This is now fixed in 2.0, I'll push the fix to 2.1 later.

It also seems that before we got this report (like hours before) we got a duplicate report on sm.org directly and that's the name that ended up in the changelog. That said, thank you for notifying us, all reports are appreciated.

Arantor avatar Oct 23 '13 01:10 Arantor

@Arantor which versions include this fix, thanks?

fgeek avatar Aug 15 '14 05:08 fgeek

2.0.6 includes this fix.

Arantor avatar Aug 15 '14 20:08 Arantor