gajus / gajus/fuss

Race the signed request based on issued_at

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
52
Forks
2
PR merge metrics
No merged PRs in 30d

Description

``` php
if (isset($_POST['signed_request'])) {
$this->setSignedRequest($_POST['signed_request']);
} else if (isset($_SESSION['gajus']['fuss'][$this->getId()]['signed_request'])) {
$this->setSignedRequest($_SESSION['gajus']['fuss'][$this->getId()]['signed_request']);
} else if (isset($_COOKIE['fbsr_' . $this->getId()])) {
$this->setSignedRequest($_COOKIE['fbsr_' . $this->getId()]);
}
```

It is incorrect to assume that `$_SESSION['gajus']['fuss'][$this->getId()]['signed_request']` will have the newest `signed_request` data. When used with [Fuss.js](https://github.com/gajus/fuss.js), `$_COOKIE` will always be fresher. Furthermore, `access_token` must be cached and included in the race condition.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue identifies the signed-request selection snippet as the entry point; start there and trace the POST, session, and cookie values used with Fuss.js. Done means freshness is determined by issued_at, with access_token included in the race and caching behavior verified by relevant project tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.