faloker / purify

All-in-one tool for managing vulnerability reports from AppSec pipelines

Home Page:https://faloker.gitbook.io/purify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid template - unable to delete

dmspils opened this issue · comments

With a template that is invalid when it is created, it becomes impossible to delete that template via the UI or API.

An example template is:

{ "title_fields": [ "vulnerability", "featurename" ], "internal_comparison_fields": [ "vulnerability", "featureversion" ], "external_comparison_fields": [ "description", "namespace" ], "body_fields": [ { "key": "featureversion", "type": "text" }, { "key": "description", "type": "text" }, { "key": "namespace", "type": "text" }, { "key": "link", "type": "text" }, { "key": "severity", "type": "text" }, { "key": "fixedby", "type": "text" } ], "merge_fields": [], "tags": [], "_id": "db40e63b-6ac7-4478-ba55-f15b4ac2328a", "path_to_issues": "string", "name": "BROKEN_DO_NOT_USE_testing_via_swagger", "title_pattern": "string", "subtitle_pattern": "string", "created_at": "2020-07-01T21:05:51.106Z", "updated_at": "2020-07-07T21:35:28.992Z", "__v": 0 }

Hitting delete in the UI results in a console warning of:

TypeError: Cannot read property '_id' of undefined at a.deleteTemplate (chunk-198405f5.dae483b3.js:1) at click (chunk-198405f5.dae483b3.js:1) at He (vue.min.js:6) at a.n (vue.min.js:6) at He (vue.min.js:6) at a.e.$emit (vue.min.js:6) at a.click (chunk-vendors.3b40113c.js:7) at He (vue.min.js:6) at HTMLButtonElement.n (vue.min.js:6) at HTMLButtonElement.Yr.o._wrapper (vue.min.js:6)

And the delete box does not go away, it becomes unresponsive.

API calls to DELETE the template result in a 500 internal server error response.