Skip to content

verifySignature does not work when the caller is not running in UTC #156

@kevcodez

Description

@kevcodez

For the webhook timestamp verification, the current date and the date from the webhook is compared. The X-Orb-Timestamp header does not include a timezone, so initializing a date using new Date will use the local timezone, instead of UTC:

const timestamp = new Date(msgTimestamp);

When your server is running in a non-UTC timezone, this will lead to multiple hours of differences between the timestamp and the current date, given the wrongly used timezone.

Two possible solutions:

  • Include the timezone in the x-orb-timestamp header (basically breaking change)
  • Assume UTC timezone (append Z when using new Date or use a different way to create the date)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions