Repository navigation
v0.41.4
Two hardening fixes from the same code review as 0.41.3. Both matter mainly when AdLoop runs as a server for several users; on your own computer they change nothing you would notice.
URL checks connect only to the address they checked
Before an ad, a sitelink or a Reddit media link is drafted, AdLoop checks that the URL answers. It refused URLs that resolve to internal addresses, but then let the request resolve the name a second time. A DNS server built for it could answer the check with a public address and the request with an internal one (DNS rebinding), and so point that request at a loopback or cloud metadata address of the machine running AdLoop. The response body was never returned, only whether and how the address answered.
The check now resolves the name once, refuses anything that is not public and connects to exactly that address, for the first request and for every redirect. It uses the same pinned connections as the image fetcher. Behind an HTTP proxy the proxy does the resolving, so nothing changes there.
Currency and account details are cached per tenant
AdLoop remembers an account's currency (Google Ads) and its currency and time zone (Reddit Ads) so it does not ask again on every call. The memory was keyed by account id only. On a server with several tenants, one tenant's lookup of an id decided what the next tenant saw for it: a wrong currency label after a failed lookup, or the Reddit account details another login had read. Amounts were never affected.
Both caches are now kept per tenant. A failed Google Ads currency lookup is also no longer remembered as EUR until the next restart: the next call asks again.