Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vulnerability][errorReport] GET errorReport.json request with 404 response #313

Closed
t2ym opened this issue Aug 27, 2019 · 0 comments
Closed

Comments

@t2ym
Copy link
Owner

t2ym commented Aug 27, 2019

[vulnerability][errorReport] GET errorReport.json request with 404 response

Root Cause

  • errorReportService.js does not handle GET requests and responds with 404 Not Found

Vulnerability

In the document

{
  let iframe = document.createElement('iframe');
  iframe.src = '/components/thin-hook/demo/errorReport.json';
  document.body.appendChild(iframe);
  iframe.contentWindow.caches;
}

Fix

  • GET errorReport.json to respond with 307 about:blank
diff --git a/demo/errorReportService.js b/demo/errorReportService.js
index b9e6a262..64390187 100644
--- a/demo/errorReportService.js
+++ b/demo/errorReportService.js
@@ -28,3 +28,6 @@ app.post('/errorReport.json', function(req, res) {
   "severity": "permissive"
 }`);
 });
+app.all('*', (req, res) => {
+  res.redirect(307, 'about:blank');
+});
t2ym added a commit that referenced this issue Aug 27, 2019
t2ym added a commit that referenced this issue Aug 27, 2019
@t2ym t2ym closed this as completed in 624c3e2 Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant