Skip to content

validateMessageIntegrity method doesn't use the payload body #98

@toddheslin

Description

@toddheslin

I've noticed that when creating the hash here:

const authenticationCode = createHmac(xHubSignatureValueParts[0], fbApplicationSecret).digest('hex');

You aren't updating with the payload body. Are you using this successfully in production for an older version of the API? The current API version requires using the payload to verify the request:

To validate the payload:

1. Generate a SHA1 signature using the payload and your app's App Secret.
2. Compare your signature to the signature in the X-Hub-Signature header (everything after sha1=). If the signatures match, the payload is genuine.

https://developers.facebook.com/docs/graph-api/webhooks/getting-started#verification-requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions