From 3b2e1cf98c065996a6645f0066dcd2d13af1d15d Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Thu, 7 Nov 2019 18:35:34 +0000 Subject: [PATCH] make sure the persona reported by the browser matches --- .../com/muwire/core/connection/ConnectionAcceptor.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy b/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy index 75664f4e..eb735576 100644 --- a/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy +++ b/core/src/main/groovy/com/muwire/core/connection/ConnectionAcceptor.groovy @@ -333,8 +333,11 @@ class ConnectionAcceptor { Persona browser = null Map headers = DataUtil.readAllHeaders(dis); - if (headers.containsKey('Persona')) + if (headers.containsKey('Persona')) { browser = new Persona(new ByteArrayInputStream(Base64.decode(headers['Persona']))) + if (browser.destination != e.destination) + throw new IOException("browser persona mismatch") + } OutputStream os = e.getOutputStream() if (!settings.browseFiles) {