mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 17:35:40 +02:00
fix: change bare activity.actor to getApId(activity.actor) in InboxPr… (#17340)
* fix: change bare activity.actor to getApId(activity.actor) in InboxProcessorService (closes #17338) * doc: update CHANGELOG.md to note fix for #17338 * fix: additional activity.actor wrappers in ApInboxService * Update CHANGELOG.md --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
@@ -259,7 +259,7 @@ export class ApInboxService {
|
||||
|
||||
@bindThis
|
||||
private async add(actor: MiRemoteUser, activity: IAdd, resolver?: Resolver): Promise<string | void> {
|
||||
if (actor.uri !== activity.actor) {
|
||||
if (actor.uri !== getApId(activity.actor)) {
|
||||
return 'invalid actor';
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ export class ApInboxService {
|
||||
|
||||
@bindThis
|
||||
private async delete(actor: MiRemoteUser, activity: IDelete): Promise<string> {
|
||||
if (actor.uri !== activity.actor) {
|
||||
if (actor.uri !== getApId(activity.actor)) {
|
||||
return 'invalid actor';
|
||||
}
|
||||
|
||||
@@ -623,7 +623,7 @@ export class ApInboxService {
|
||||
|
||||
@bindThis
|
||||
private async remove(actor: MiRemoteUser, activity: IRemove, resolver?: Resolver): Promise<string | void> {
|
||||
if (actor.uri !== activity.actor) {
|
||||
if (actor.uri !== getApId(activity.actor)) {
|
||||
return 'invalid actor';
|
||||
}
|
||||
|
||||
@@ -643,7 +643,7 @@ export class ApInboxService {
|
||||
|
||||
@bindThis
|
||||
private async undo(actor: MiRemoteUser, activity: IUndo, resolver?: Resolver): Promise<string> {
|
||||
if (actor.uri !== activity.actor) {
|
||||
if (actor.uri !== getApId(activity.actor)) {
|
||||
return 'invalid actor';
|
||||
}
|
||||
|
||||
@@ -777,7 +777,7 @@ export class ApInboxService {
|
||||
|
||||
@bindThis
|
||||
private async update(actor: MiRemoteUser, activity: IUpdate, resolver?: Resolver): Promise<string> {
|
||||
if (actor.uri !== activity.actor) {
|
||||
if (actor.uri !== getApId(activity.actor)) {
|
||||
return 'skip: invalid actor';
|
||||
}
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@ export class InboxProcessorService implements OnApplicationShutdown {
|
||||
// 対象が4xxならスキップ
|
||||
if (err instanceof StatusError) {
|
||||
if (!err.isRetryable) {
|
||||
throw new Bull.UnrecoverableError(`skip: Ignored deleted actors on both ends ${activity.actor} - ${err.statusCode}`);
|
||||
throw new Bull.UnrecoverableError(`skip: Ignored deleted actors on both ends ${getApId(activity.actor)} - ${err.statusCode}`);
|
||||
}
|
||||
throw new Error(`Error in actor ${activity.actor} - ${err.statusCode}`);
|
||||
throw new Error(`Error in actor ${getApId(activity.actor)} - ${err.statusCode}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ export class InboxProcessorService implements OnApplicationShutdown {
|
||||
const httpSignatureValidated = httpSignature.verifySignature(signature, authUser.key.keyPem);
|
||||
|
||||
// また、signatureのsignerは、activity.actorと一致する必要がある
|
||||
if (!httpSignatureValidated || authUser.user.uri !== activity.actor) {
|
||||
if (!httpSignatureValidated || authUser.user.uri !== getApId(activity.actor)) {
|
||||
// 一致しなくても、でもLD-Signatureがありそうならそっちも見る
|
||||
const ldSignature = activity.signature;
|
||||
if (ldSignature) {
|
||||
@@ -187,8 +187,8 @@ export class InboxProcessorService implements OnApplicationShutdown {
|
||||
//#endregion
|
||||
|
||||
// もう一度actorチェック
|
||||
if (authUser.user.uri !== activity.actor) {
|
||||
throw new Bull.UnrecoverableError(`skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${activity.actor})`);
|
||||
if (authUser.user.uri !== getApId(activity.actor)) {
|
||||
throw new Bull.UnrecoverableError(`skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${getApId(activity.actor)})`);
|
||||
}
|
||||
|
||||
const ldHost = this.utilityService.extractDbHost(authUser.user.uri);
|
||||
|
||||
Reference in New Issue
Block a user