-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(backend): reject malformed timestamp #12554
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #12554 +/- ##
===========================================
- Coverage 78.79% 78.76% -0.04%
===========================================
Files 954 953 -1
Lines 103756 103735 -21
Branches 8346 8348 +2
===========================================
- Hits 81756 81707 -49
- Misses 22000 22028 +28 ☔ View full report in Codecov by Sentry. |
このPRによるapi.jsonの差分 差分はこちら |
@@ -306,9 +306,15 @@ export class ApInboxService { | |||
this.logger.info(`Creating the (Re)Note: ${uri}`); | |||
|
|||
const activityAudience = await this.apAudienceService.parseAudience(actor, activity.to, activity.cc); | |||
const createdAt = activity.published ? new Date(activity.published) : null; | |||
|
|||
if (createdAt && createdAt < this.idService.parse(renote.id).date) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この判定は無いとどんな問題がある?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renote の Note ID が同様の問題を発生させる可能性がある
そもそも Renote が参照先の Note より先に発行されるはずはないため、そういう条件で判定している
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
まぁリモートのサーバーの時計がぶっ壊れてたらここに到達する可能性は否めないが、それは NTP 設定してくれ〜すぎるので
🙏🏻 |
What
リモートの Activity のタイムスタンプによってタイムスタンプ部がクランプされる ID が生成されるとき、その Activity を拒否する
Why
Fix #12401
Additional info (optional)
Checklist