π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
fix: security warnings related to information exposure and regex validations (#3325)
Nikhil02a776396be3
diff --git a/apiserver/plane/api/views/base.py b/apiserver/plane/api/views/base.pyindex abde4e8b01..035266bd5c 100644--- a/apiserver/plane/api/views/base.py+++ b/apiserver/plane/api/views/base.py@@ -104,15 +104,14 @@ class BaseAPIView(TimezoneMixin, APIView, BasePaginator):)if isinstance(e, ObjectDoesNotExist):- model_name = str(exc).split(" matching query does not exist.")[0]return Response(- {"error": f"{model_name} does not exist."},+ {"error": f"The required object does not exist."},status=status.HTTP_404_NOT_FOUND,)if isinstance(e, KeyError):return Response(- {"error": f"key {e} does not exist"},+ {"error": f" The required key does not exist."},status=status.HTTP_400_BAD_REQUEST,)diff --git a/apiserver/plane/app/views/base.py b/apiserver/plane/app/views/base.pyindex 32449597bd..aeb7c015e5 100644--- a/apiserver/plane/app/views/base.py+++ b/apiserver/plane/app/views/base.py@@ -112,16 +112,15 @@ class BaseViewSet(TimezoneMixin, ModelViewSet, BasePaginator):)if isinstance(e, ObjectDoesNotExist):- model_name = str(exc).split(" matching query does not exist.")[0]return Response(- {"error": f"{model_name} does not exist."},+ {"error": f"The required object does not exist."},status=status.HTTP_404_NOT_FOUND,)if isinstance(e, KeyError):capture_exception(e)return Response(- {"error": f"key {e} does not exist"},+ {"error": f"The required key does not exist."},status=status.HTTP_400_BAD_REQUEST,)@@ -201,14 +200,13 @@ class BaseAPIView(TimezoneMixin, APIView, BasePaginator):)if isinstance(e, ObjectDoesNotExist):- model_name = str(exc).split(" matching query does not exist.")[0]return Response(- {"error": f"{model_name} does not exist."},+ {"error": f"The required object does not exist."},status=status.HTTP_404_NOT_FOUND,)if isinstance(e, KeyError):- return Response({"error": f"key {e} does not exist"}, status=status.HTTP_400_BAD_REQUEST)+ return Response({"error": f"The required key does not exist."}, status=status.HTTP_400_BAD_REQUEST)if settings.DEBUG:print(e)diff --git a/apiserver/plane/space/views/base.py b/apiserver/plane/space/views/base.pyindex b1d749a09f..7a819095b7 100644--- a/apiserver/plane/space/views/base.py+++ b/apiserver/plane/space/views/base.py@@ -85,14 +85,14 @@ class BaseViewSet(TimezoneMixin, ModelViewSet, BasePaginator):if isinstance(e, ObjectDoesNotExist):model_name = str(exc).split(" matching query does not exist.")[0]return Response(- {"error": f"{model_name} does not exist."},+ {"error": f"The required object does not exist."},status=status.HTTP_404_NOT_FOUND,)if isinstance(e, KeyError):capture_exception(e)return Response(- {"error": f"key {e} does not exist"},+ {"error": "The required key does not exist."},status=status.HTTP_400_BAD_REQUEST,)@@ -172,14 +172,13 @@ class BaseAPIView(TimezoneMixin, APIView, BasePaginator):)if isinstance(e, ObjectDoesNotExist):- model_name = str(exc).split(" matching query does not exist.")[0]return Response(- {"error": f"{model_name} does not exist."},+ {"error": f"The required object does not exist."},status=status.HTTP_404_NOT_FOUND,)if isinstance(e, KeyError):- return Response({"error": f"key {e} does not exist"}, status=status.HTTP_400_BAD_REQUEST)+ return Response({"error": "The required key does not exist."}, status=status.HTTP_400_BAD_REQUEST)if settings.DEBUG:print(e)diff --git a/apiserver/plane/utils/issue_search.py b/apiserver/plane/utils/issue_search.pyindex 40f85dde44..d38b1f4c32 100644--- a/apiserver/plane/utils/issue_search.py+++ b/apiserver/plane/utils/issue_search.py@@ -12,8 +12,8 @@ def search_issues(query, queryset):fields = ["name", "sequence_id"]q = Q()for field in fields:- if field == "sequence_id":- sequences = re.findall(r"\d+\.\d+|\d+", query)+ if field == "sequence_id" and len(query) <= 20:+ sequences = re.findall(r"[A-Za-z0-9]{1,12}-\d+", query)for sequence_id in sequences:q |= Q(**{"sequence_id": sequence_id})else:diff --git a/apiserver/plane/utils/paginator.py b/apiserver/plane/utils/paginator.pyindex 793614cc08..3563dad34c 100644--- a/apiserver/plane/utils/paginator.py+++ b/apiserver/plane/utils/paginator.py@@ -188,7 +188,7 @@ class BasePaginator:try:cursor_result = paginator.get_result(limit=per_page, cursor=input_cursor)except BadPaginationError as e:- raise ParseError(detail=str(e))+ raise ParseError(detail="Error in parsing")# Serialize result according to the on_result functionif on_results: