Deployments where Traefik never polls the HTTP provider (file_mode edge
nodes, Kubernetes CRDs) can now switch the endpoint off instead of
managing a token.
PAN-1885
AI provider upstreamUrl was only z.url() and the AI gateway streamed the
upstream response back, so any org admin could read internal services,
Pangolin's own internal API or the cloud metadata service (prod had a
provider pointed at 169.254.169.254). Alert webhooks and HTTP log
streaming fetched any URL and followed redirects.
- server/lib/outboundAddress.ts (no config dependency, unit tested):
always refuses loopback, unspecified, link-local, broadcast, multicast
and reserved addresses (incl. IPv4-mapped forms), localhost and
Pangolin's own service names; refuses RFC1918/ULA/CGNAT when private
outbound is blocked. Provides a resolver check and a connect-time DNS
lookup so rebinding cannot get around it.
- server/lib/outboundUrlGuard.ts: policy from config. New
flags.block_private_outbound_urls defaults to on for SaaS, off for
self-hosted (local models).
- aiGatewayUpstreamFetch checks the host and passes the guarded lookup to
every upstream request; create/updateAiProvider reject blocked URLs.
- sendAlertWebhook and HttpLogDestination check the URL before sending
and no longer follow redirects.
- Migration notes cover the flag and a query for providers that will
stop working.
PAN-1799 (3v9x, 4g5q)
Traefik dials a local site's targets from inside Pangolin's own network, so
an org admin could create a local site with a target such as pangolin:3001
and publish the internal API (including the unauthenticated
/traefik-config, which lists every org's header values and gateway trust
tokens) on their own hostname. disable_local_sites was only read by the
dashboard; the server-side check in createSite was commented out.
- createSite refuses local sites when flags.disable_local_sites is set or
"local" is not in traefik.site_types, and basic WireGuard sites when
flags.disable_basic_wireguard_sites is set.
- New localSiteTargetError rejects loopback, unspecified, link-local
(incl. 169.254.169.254), broadcast, localhost, the internal hostname,
gerbil, traefik and badger. createTarget, updateTarget and blueprint
targets refuse them on local sites, and both Traefik config generators
skip existing ones.
- Optional traefik.config_token: when set, GET /traefik-config requires
"Authorization: Bearer <token>" (constant-time compare). Unset keeps the
old behaviour and logs a warning once. The installer now generates the
token and writes it to config.yml and Traefik's HTTP provider headers.
- Migration notes for 1.28.0 cover the config change and a query for
existing targets that will stop routing.
PAN-1885 / GHSA-jrw8, rx89 part of PAN-1799
Reworks the org-scoped exchange-token endpoint into a root-gated create-session route,
addressing the review on the earlier version:
- Requires a ROOT API key holding the createIdpSession action, not an org-scoped key.
Minting a session is impersonation, so it is deliberately root-only.
- Gated behind flags.enable_idp_create_session (off by default, self-hosted only;
refused when build === "saas").
- Drops orgId entirely: the user must belong to the identity provider, not an
organization. The route becomes /idp/:idpId/oidc/create-session.
Removes the now-unused org-scoped createSessionForIdpUser helper.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pangolin consults the IdP only at login and keeps its own session
afterwards, so disabling a user or revoking their sessions in the IdP
does not end their Pangolin sessions.
Store the IdP refresh token at OIDC login as a grant and redeem it at
most every server.idp_session_revalidation_minutes (default 5). If the
IdP rejects it with invalid_grant, the grant is marked revoked and all
sessions backed by it and their resource sessions are deleted. Other
errors (IdP unreachable or slower than 10 seconds, invalid_client after
a secret change) keep the sessions valid and are retried after at most
a minute instead of on every request.
Only the instance holding a lease on the grant in the primary database
redeems its refresh token, and it writes the result only while it still
holds the lease, so instances never redeem the same token concurrently.
The per-request lookup reads from a replica through safeRead.
Device logins of the Pangolin clients share the grant of the browser
session that approved them, read from the primary database, so a rotated
refresh token is never redeemed twice by separate sessions.
The Entra ID provider type hardcodes its scopes, so it now requests
offline_access to get a refresh token.
- Add MaxMind ASN database integration
- Implement ASN lookup and matching in resource rule verification
- Add curated list of 100+ major ASNs (cloud, ISP, CDN, mobile carriers)
- Add ASN dropdown selector in resource rules UI with search functionality
- Support custom ASN input for unlisted ASNs
- Add 'ALL ASNs' special case handling (AS0)
- Cache ASN lookups with 5-minute TTL for performance
- Update validation schemas to support ASN match type
This allows administrators to create resource access rules based on
Autonomous System Numbers, similar to existing country-based rules.
Useful for restricting access by ISP, cloud provider, or mobile carrier.