CVE-2022-39268 (published 2022-09-30T21:15Z)

### Impact In a CSRF attack, an innocent end user is tricked by an attacker into submitting a web request that they did not intend. This may cause actions to be performed on the website that can include inadvertent client or server data leakage, change of session state, or manipulation of an end user's account. ### Patch Upgrade to v2022.09.10 to patch this vulnerability. ### Workarounds Rebuild and redeploy the Orchest `auth-server` with this commit: https://github.com/orchest/orchest/commit/c2587a963cca742c4a2503bce4cfb4161bf64c2d ### References https://en.wikipedia.org/wiki/Cross-site_request_forgery https://cwe.mitre.org/data/definitions/352.html ### For more information If you have any questions or comments about this advisory: * Open an issue in https://github.com/orchest/orchest * Email us at rick@orchest.io

CVSS v3 base score: 8.1, HIGH (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N)

Weakness information:
cwe_id: CWE-352
cwe_name: Cross-Site Request Forgery (CSRF)
description: The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
extended_description: When a web server is designed to receive a request from a client without any mechanism for verifying that it was intentionally sent, then it might be possible for an attacker to trick a client into making an unintentional request to the web server which will be treated as an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.
         

Fix information:
repo_url: https://github.com/orchest/orchest
commit_details: repo_url: https://github.com/orchest/orchest
author: gobbijacopo91@gmail.com
author_date: 2022-09-30 15:24:32+02:00
msg: Set auth cookies to SameSite=Lax
repository: repo_url: https://github.com/orchest/orchest
repo_name: orchest/orchest
description: Build data pipelines, the easy way 🛠️
repo_language: TypeScript
owner: orchest
file_changes: filename: views.py
change_type: ModificationType.MODIFY
diff: @@ -114,8 +114,8 @@ def register_views(app: Flask) -> None:
     @app.route("/login/clear", methods=["GET"])
     def logout() -> Response | None:
         resp = redirect_response("/")
-        resp.set_cookie("auth_token", "")
-        resp.set_cookie("auth_username", "")
+        resp.set_cookie("auth_token", "", samesite="Lax")
+        resp.set_cookie("auth_username", samesite="Lax")
         return resp
 
     def redirect_response(url: str, redirect_type: str = "server") -> Response:
@@ -182,8 +182,9 @@ def register_views(app: Flask) -> None:
                     db.session.commit()
 
                     resp = redirect_response(redirect_url, redirect_type)
-                    resp.set_cookie("auth_token", token.token)
-                    resp.set_cookie("auth_username", username)
+                    # samesite="Lax" to avoid CSRF attacks.
+                    resp.set_cookie("auth_token", token.token, samesite="Lax")
+                    resp.set_cookie("auth_username", username, samesite="Lax")
 
                     return resp
 

programming_language: Python