Open cjackett opened 2 months ago
Thanks again for participating! This submission earned $22.68 from SIV and $88.57 from the Public Vote, for a total of $111.25.
Here's what we noted in our evaluation:
Issue to track getting paid: https://github.com/siv-org/hack.siv.org/issues/10
Issue Description
Note: This is a rewrite of the original issue, separating concerns related to CORS and a potential DoS attack vector, now located at https://github.com/siv-org/siv/issues/205.
The current CORS implementation in the following API endpoints allows requests from any origin by setting
Access-Control-Allow-Origin: *
. This overly permissive CORS policy introduces a security vulnerability by permitting potentially unauthorized cross-origin requests, which could lead to data misuse or unauthorized actions. The affected endpoints are:/api/email-signup
/api/hack-siv/register
/api/ukraine-updates-subscribe
Exploitation Attempt
An exploit page was created to demonstrate how an attacker might abuse this vulnerability. The page attempts to send unauthorized POST requests to the vulnerable endpoints, potentially submitting fraudulent data or triggering unauthorized actions:
Testing Results
When the exploit page was run locally, the browser blocked the cross-origin requests due to the following reasons:
credentials: 'include'
) when theAccess-Control-Allow-Origin
header is set to*
. This led to the error:Despite these errors, the exploit could potentially succeed if the page is hosted on a different domain rather than
localhost
. In a real-world scenario, an attacker could upload this exploit page to a publicly accessible domain and run it against the SIV system to perform unauthorized actions.Mitigation
To mitigate this risk, modify the CORS implementation to only allow requests from the trusted origin
https://siv.org
. This can be done by dynamically setting theAccess-Control-Allow-Origin
header based on the request's origin:This approach will ensure that only requests originating from trusted domains can access the API, thereby reducing the risk of unauthorized access.
It is important to note that the scope of this attack is limited to the three email registration pages mentioned above, which reduces the potential impact. However, addressing this vulnerability is still crucial to prevent any possible misuse or unauthorized data submissions.