Nothing limits how fast an account can make the server fetch a URL, or hit the API #112
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#112
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by
A security audit. Not reachable by a stranger -- every surface here needs an account or a
token -- but nothing bounds what an account may do once it has one.
What is already protected
allauth's own limits are in force with a cache behind them, so authentication is covered:
TrustedProxyMiddlewarealso gets the key right: it takes the rightmost untrusted entryof
X-Forwarded-Forand strips forwarding headers from peers that are not proxies, so aper-IP limit is per person rather than per proxy. Checked rather than assumed.
What is not
Capture is the one that matters.
/jobs/captures/new/makes Postulo itself issue anoutbound request to an address the caller supplies.
check_destinationrefuses privateaddresses and revalidates on redirect -- the audit probed loopback,
169.254.169.254,[::1],10.0.0.0/8,file://andgopher://, and every one was refused, so this is notSSRF. What is missing is a bound on how often. One account can ask the instance to fetch
as fast as it can, which turns somebody's self-hosted box into a modest scanner or exhausts
its own outbound connections.
The API applies no limit of its own.
api/auth.pylooks a token up by hash and returnsit; there is no throttle at any layer. A token is 32 bytes and hashed at rest, so this is
about a valid token rather than a guessed one.
/logsand/metricsare token-guarded --hmac.compare_digest, checked -- andunbounded.
What would fix it
A limit keyed on the account rather than the address, since all of these require one, and a
number an operator can raise: an instance with three people has different needs from one
with three hundred. Capture deserves the tightest, because it is the only one that makes the
server talk to somebody else's.
Worth deciding whether to add a dependency or write it against the cache that already backs
allauth's limits. The second is a few lines and brings no new supply chain.
Classification
Security, enhancement. Tier 2: no data is at risk, and an instance can be made to work very
hard by anybody holding an account on it.