Files
pangolin/server/middlewares
Marc Schäfer 51629247a5 fix(middleware): prevent cross-org site binding in target create/update
Extend verifySiteAccess to check that when req.userOrgId is already set
by a prior middleware (e.g. verifyResourceAccess/verifyTargetAccess), the
site from req.body.siteId belongs to the same organization. This prevents
the cross-organization tunnel boundary bypass where an attacker with
resource access in one org binds that resource's target to a site in
another org.

Add verifySiteAccess to both target route stacks:
- PUT /resource/:resourceId/target (after verifyResourceAccess)
- POST /target/:targetId (after verifyTargetAccess)

The org-match check runs before req.userOrg is overwritten, so the
resource's organization context is preserved for comparison.

Signed-off-by: Marc Schäfer <git@marcschaeferger.de>
2026-05-29 22:44:16 +00:00
..
2024-12-25 22:04:20 -05:00
2025-12-09 10:56:14 -05:00
2026-02-24 17:58:11 -08:00
2025-10-27 13:45:24 -07:00
2024-10-26 17:19:10 -04:00
2025-12-09 10:56:14 -05:00
2025-12-09 10:56:14 -05:00
2026-02-24 17:58:11 -08:00
2026-02-24 17:58:11 -08:00
2026-02-24 17:58:11 -08:00
2026-02-24 17:58:11 -08:00
2025-11-25 10:51:53 -05:00
2026-02-24 17:58:11 -08:00
2025-11-25 10:51:53 -05:00
2026-02-24 17:58:11 -08:00