summaryrefslogtreecommitdiff
path: root/internal/processing/workers
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-08-13 15:37:09 +0000
committerLibravatar GitHub <noreply@github.com>2024-08-13 15:37:09 +0000
commit9cd27b412d75ab9cb26054aa85d0eca82d78552e (patch)
tree8e8bfc0997fc53a0a193b7d5e192112cfc024cc4 /internal/processing/workers
parent[bugfix] relax missing preferred_username, instead using webfingered username... (diff)
downloadgotosocial-9cd27b412d75ab9cb26054aa85d0eca82d78552e.tar.xz
[security] harden account update logic (#3198)
* on account update, ensure that public key has not changed * change expected error message * also support the case of changing account keys when expired (not waiting for handshake) * tweak account update hardening logic, add tests for updating account with pubkey expired * add check for whether incoming data was via federator, accepting keys if so * use freshest window for federated account updates + comment about it
Diffstat (limited to 'internal/processing/workers')
-rw-r--r--internal/processing/workers/fromfediapi.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/processing/workers/fromfediapi.go b/internal/processing/workers/fromfediapi.go
index 31df9d284..ce7c53388 100644
--- a/internal/processing/workers/fromfediapi.go
+++ b/internal/processing/workers/fromfediapi.go
@@ -674,8 +674,13 @@ func (p *fediAPI) UpdateAccount(ctx context.Context, fMsg *messages.FromFediAPI)
fMsg.Receiving.Username,
account,
apubAcc,
- // Force refresh within 5min window.
- dereferencing.Fresh,
+
+ // Force refresh within 10s window.
+ //
+ // Missing account updates could be
+ // detrimental to federation if they
+ // include public key changes.
+ dereferencing.Freshest,
)
if err != nil {
log.Errorf(ctx, "error refreshing account: %v", err)