1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 00:37:35 +00:00

Browser+LibWeb+WebContent: Parse cookies in the OOP tab

To protect the main Browser process against nefarious cookies, parse the
cookies out-of-process and then send the parsed result over IPC to the
main process. This way, if the cookie parser blows up, only that tab
will be affected.
This commit is contained in:
Timothy Flynn 2021-04-15 10:36:20 -04:00 committed by Andreas Kling
parent 6e10c2cdb7
commit 2381b19719
19 changed files with 79 additions and 26 deletions

View file

@ -47,7 +47,7 @@ struct CookieStorageKey {
class CookieJar {
public:
String get_cookie(const URL& url, Web::Cookie::Source source);
void set_cookie(const URL& url, const String& cookie, Web::Cookie::Source source);
void set_cookie(const URL& url, const Web::Cookie::ParsedCookie& parsed_cookie, Web::Cookie::Source source);
void dump_cookies() const;
private:
@ -56,7 +56,7 @@ private:
static bool path_matches(const String& request_path, const String& cookie_path);
static String default_path(const URL& url);
void store_cookie(Web::Cookie::ParsedCookie& parsed_cookie, const URL& url, String canonicalized_domain, Web::Cookie::Source source);
void store_cookie(const Web::Cookie::ParsedCookie& parsed_cookie, const URL& url, String canonicalized_domain, Web::Cookie::Source source);
Vector<Web::Cookie::Cookie*> get_matching_cookies(const URL& url, const String& canonicalized_domain, Web::Cookie::Source source);
void purge_expired_cookies();