From db92003e5f1818b3842d82e1189999ddf34ed23f Mon Sep 17 00:00:00 2001
From: Son NK <>
Date: Sat, 2 May 2020 12:15:03 +0200
Subject: [PATCH] Anti tamper: avoid submitting any suffix
---
app/config.py | 1 +
.../templates/dashboard/custom_alias.html | 2 +-
app/dashboard/views/custom_alias.py | 36 +++++++++++++------
tests/dashboard/test_custom_alias.py | 9 +++--
4 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/app/config.py b/app/config.py
index 86c65a42..1ffc40ea 100644
--- a/app/config.py
+++ b/app/config.py
@@ -123,6 +123,7 @@ DB_URI = os.environ["DB_URI"]
# Flask secret
FLASK_SECRET = os.environ["FLASK_SECRET"]
MAILBOX_SECRET = FLASK_SECRET + "mailbox"
+CUSTOM_ALIAS_SECRET = FLASK_SECRET + "custom_alias"
# AWS
AWS_REGION = "eu-west-3"
diff --git a/app/dashboard/templates/dashboard/custom_alias.html b/app/dashboard/templates/dashboard/custom_alias.html
index 1767da02..edb7d9af 100644
--- a/app/dashboard/templates/dashboard/custom_alias.html
+++ b/app/dashboard/templates/dashboard/custom_alias.html
@@ -42,7 +42,7 @@