Skip to content

Commit c69006e

Browse files
committed
fix: acl check for subdomain on access
1 parent 81ad324 commit c69006e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/src/routers/hosting/puter-site.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ class PuterSiteMiddleware extends AdvancedBase {
147147
res.status(502).send('subdomain is pointing to non-directory');
148148
}
149149

150+
// Verify subdomain owner permission
151+
const subdomain_actor = Actor.adapt(subdomain_owner);
152+
const svc_acl = services.get('acl');
153+
if ( ! await svc_acl.check(subdomain_actor, node, 'read') ) {
154+
res.status(502).send('subdomain owner does not have access to directory');
155+
return;
156+
}
157+
150158
subdomain_root_path = await node.get('path');
151159
}
152160

0 commit comments

Comments
 (0)