Osclass <= 3.4.2 (contact.php) Unrestricted File Upload Vulnerability
The contact form's file attachment handling in Osclass saves uploaded files to a web-accessible uploads directory without properly restricting the file type. An attacker could upload a file with an executable or script extension and potentially have it run on the server.
karmainsecurity.com
Published on karmainsecurity.com
The vulnerable code is located in the /oc-includes/osclass/controller/contact.php script:
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the upload handler trusts the client-supplied file name and type and writes the file into a web-served directory without validating or restricting the extension.
What the attacker needed
Contact form with attachment enabled; uploads directory writable
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A website's contact form lets visitors attach a file. This code saves whatever file is attached into a folder that the web server can serve and run, without checking the file type properly. That means someone could upload a script instead of a harmless document and get it executed on the server.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.