Replies: 7 comments
-
🌎 Support status🗺 Spec status❌ I found it interesting regarding the Deprecation Reporting feature but the specification is an Unofficial Draft that was not updated since 2020. 📖 Sources & References
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
POCI performed the following POC using projectdiscovery/simplehttpserver as a local HTTPS web server. 💻Command line used to start the server and set reporting endpoints: simplehttpserver -verbose -https -cert righettod.local.pem -key righettod.local-key.pem -cors -header "Reporting-Endpoints: report-handler=\"https://righettod.local:8000/report.html\"" -header "Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; report-to report-handler" -header "Permissions-Policy: sync-xhr=(), report-to=report-handler" 📄Sample html page expected to trigger violation reports: <!DOCTYPE html>
<html>
<head>
<title>POC</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<!-- Content Security Policy (CSP) violation here -->
<img src="https://picsum.photos/536/354">
<!-- Permission Policy (PP) violation here -->
<script>
const req = new XMLHttpRequest();
req.open("GET", "/favicon.ico");
req.send();
</script>
</body>
</html> Browser usedChrome 136. Key points
Observations✅ The CSP violation was correctly received. 🤔The following error was mentioned by Chrome for PP: Error with Permissions-Policy header: Unrecognized feature: 'report-to'. The PP documentation on MDN was not mentioning the report-to parameters but the W3C specification was mentioning it. 🤖Reply from ChatGPT: 🤖Reply from Gemini: 🤖Result tends to prove ChatGPT right. Point of view💡From a security perspective, the following behavior for 🤔Chrome created a default endpoint pointing to the single endpoint defined in the header: 🤔I need to delve deeper into this potential behavior to better understand it and how it can be used from a defensive security point of view... |
Beta Was this translation helpful? Give feedback.
-
BrowserChromium 138 was used to ensure to use the most recent possible version of the foundation of Chromium based browser like Edge/Chrome/... Version: Documentation used
Web server💻Web server started using the following command: simplehttpserver -verbose -https -cert righettod.local.pem -key righettod.local-key.pem -cors -header "Reporting-Endpoints: default=\"https://righettod.local:8000/report.html\"" ✅Default endpoint correctly created by the browser: Tests performedLoad a site with an expired TLS certificate💻Code: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>POC</title>
</head>
<body>
<iframe src="https://expired.badssl.com/"></iframe>
</body>
</html> ❌No report received. Reject a request for geolocation💻Code generated with the help of Gemini: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Geolocation Example</title>
</head>
<body>
<h1>Get Your Current Location</h1>
<button id="getLocationButton">Get My Location</button>
<div id="locationData"></div>
<script>
const locationDataDiv = document.getElementById('locationData');
const getLocationButton = document.getElementById('getLocationButton');
getLocationButton.addEventListener('click', () => {
if ("geolocation" in navigator) {
locationDataDiv.textContent = 'Requesting location...';
// Options for the geolocation request
const options = {
enableHighAccuracy: true, // Try to get the best possible result
timeout: 5000, // Max time (ms) to wait for a result
maximumAge: 0 // Don't use a cached position; get a fresh one
};
navigator.geolocation.getCurrentPosition(
(position) => { // Success callback
const latitude = position.coords.latitude;
const longitude = position.coords.longitude;
const accuracy = position.coords.accuracy; // Accuracy in meters
locationDataDiv.innerHTML = `
<p><strong>Latitude:</strong> ${latitude}</p>
<p><strong>Longitude:</strong> ${longitude}</p>
<p><strong>Accuracy:</strong> ±${accuracy} meters</p>
<p>Timestamp: ${new Date(position.timestamp)}</p>
`;
console.log('Geolocation success:', position);
},
(error) => { // Error callback
let errorMessage = 'Error getting location: ';
switch (error.code) {
case error.PERMISSION_DENIED:
errorMessage += "User denied the request for Geolocation.";
break;
case error.POSITION_UNAVAILABLE:
errorMessage += "Location information is unavailable.";
break;
case error.TIMEOUT:
errorMessage += "The request to get user location timed out.";
break;
case error.UNKNOWN_ERROR:
errorMessage += "An unknown error occurred.";
break;
}
locationDataDiv.textContent = errorMessage;
console.error('Geolocation error:', error);
},
options // Pass the options object
);
} else {
locationDataDiv.textContent = "Geolocation is not supported by this browser.";
console.warn("Geolocation not supported.");
}
});
</script>
</body>
</html> ❌Geolocation request rejected but no report was received: 🤔Based on the documentation, such type of event should generate an intervention report type that it will be send the default endpoint: 🤔Perhaps I missed something and ChatGPT help me to understand: 🤖I asked ChatGPT to generate me a POC: ❌I tried it but no report was received so I asked why. The response from ChatGPT was an hallucination: 🧑💻I tried several other examples with the help of Gemini+ChatGPT without success. 🤔I surely miss something... |
Beta Was this translation helpful? Give feedback.
-
Hi @righettod I was able to reproduce with the following setup. target_server.py
report_collector.py
Generate self-signed cert:
Run report_collector.py and target_server.py in different terminals.
Check the report_collector.py terminal. |
Beta Was this translation helpful? Give feedback.
-
Nice @riramar , thanks a lot 🥰🥰🥰🥰 |
Beta Was this translation helpful? Give feedback.
-
There's a subtle hint in my aim:, My goal is to trigger a event of type intervention that should trigger a report that should be send to the default endpoint defined via the Report-Endpoints response header 😉 My goal is to see if the Report-Endpoints response header can be used to define a notification endpoints (as a spy) to detect strange or unexpected or malicious usage of a "page" 🤔 However, a huge thanks for your help and support on this analysis 🥰 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
📡 Track the evolution of the support of the HTTP response header Reporting-Endpoints to see if it can become a candidate to be added to the project.
Beta Was this translation helpful? Give feedback.
All reactions