Impact
PILOS includes a Cross-Origin Resource Sharing (CORS) misconfiguration in its middleware: it reflects the Origin request header back in the Access-Control-Allow-Origin response header without proper validation or a whitelist, while Access-Control-Allow-Credentials is set to true. This behavior could allow a malicious website on a different origin to send requests (including credentials) to the PILOS API.
This may enable exfiltration or actions using the victim’s credentials if the server accepts those cross-origin requests as authenticated.
Laravel’s session handling applies additional origin checks such that cross-origin requests are not authenticated by default. Because of these session-origin protections, and in the absence of any other unknown vulnerabilities that would bypass Laravel’s origin/session checks, this reflected-Origin CORS misconfiguration is not believed to be exploitable in typical PILOS deployments.
Patches
This vulnerability has been patched in PILOS in v4.8.0
Workarounds
Remove CORS headers in reverse proxy.
NGINX
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_hide_header Access-Control-Allow-Origin;
+ proxy_hide_header Access-Control-Allow-Credentials;
proxy_http_version 1.1;
}
APACHE
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:5000/" nocanon
ProxyPassReverse "/" "http://127.0.0.1:5000/"
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
+ Header unset Access-Control-Allow-Origin
+ Header unset Access-Control-Allow-Credentials
Impact
PILOS includes a Cross-Origin Resource Sharing (CORS) misconfiguration in its middleware: it reflects the
Originrequest header back in theAccess-Control-Allow-Originresponse header without proper validation or a whitelist, whileAccess-Control-Allow-Credentialsis set to true. This behavior could allow a malicious website on a different origin to send requests (including credentials) to the PILOS API.This may enable exfiltration or actions using the victim’s credentials if the server accepts those cross-origin requests as authenticated.
Laravel’s session handling applies additional origin checks such that cross-origin requests are not authenticated by default. Because of these session-origin protections, and in the absence of any other unknown vulnerabilities that would bypass Laravel’s origin/session checks, this reflected-Origin CORS misconfiguration is not believed to be exploitable in typical PILOS deployments.
Patches
This vulnerability has been patched in PILOS in v4.8.0
Workarounds
Remove CORS headers in reverse proxy.
NGINX
location / { proxy_pass http://127.0.0.1:5000; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_hide_header Access-Control-Allow-Origin; + proxy_hide_header Access-Control-Allow-Credentials; proxy_http_version 1.1; }APACHE