File Upload and CORS Vulnerabilities in University Portal

File Upload and CORS Exploit in Real-World Apps – Case Study from a University Portal

Published on July 18, 2025 by HVSec Team

During a university penetration test, we uncovered two major security flaws – Unrestricted File Upload and a Misconfigured CORS Policy. Both could be exploited to gain full control over user data and the web application.

1. Vulnerability: Unrestricted File Upload

The student assignment portal allowed PDF uploads but did not properly validate file types. Attackers could upload a disguised .php file as a .pdf and execute it on the server.
Uploaded files were stored in a web-accessible directory with no content-disposition headers, making them executable directly in the browser.

Exploit Path: studentportal.edu/uploads/shell.php

2. Vulnerability: Misconfigured CORS Policy

The application returned overly permissive CORS headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
This configuration allowed attackers to host a malicious script on attacker.com and steal user sessions from the portal using cross-origin requests.

How We Demonstrated the Attack

Impact of the Vulnerabilities

Recommendations We Provided

Key Takeaway: Even educational portals hold sensitive data and must follow secure file upload practices and proper CORS configurations to prevent critical breaches.