1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-23 14:46:40 +09:00

security(ghsa-gq5q-c77c-v236): Block recursive proxy (MisskeyIO#776)

[ghsa-gq5q-c77c-v236](https://github.com/misskey-dev/misskey/security/advisories/ghsa-gq5q-c77c-v236)

Co-authored-by: 饺子w (Yumechi) <35571479+eternal-flame-AD@users.noreply.github.com>
This commit is contained in:
あわわわとーにゅ 2024-10-23 04:03:23 +09:00 committed by GitHub
parent 30ad8544de
commit 6e07857b1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -319,6 +319,12 @@ export class FileServerService {
);
}
if (!request.headers['user-agent']) {
throw new StatusError('User-Agent is required', 400, 'User-Agent is required');
} else if (request.headers['user-agent'].toLowerCase().indexOf('misskey/') !== -1) {
throw new StatusError('Refusing to proxy a request from another proxy', 403, 'Proxy is recursive');
}
// Create temp file
const file = await this.getStreamAndTypeFromUrl(url);
if (file === '404') {