1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Check that filename matches ID in csaf_provider

This commit is contained in:
Bernhard Herzog 2023-05-09 18:46:00 +02:00
parent c37b127d82
commit 6a91c29baf

View file

@ -196,6 +196,11 @@ func (c *controller) upload(r *http.Request) (any, error) {
return nil, err
}
if util.CleanFileName(ex.ID) != newCSAF {
return nil, fmt.Errorf("ID %q does not match filename %s",
ex.ID, newCSAF)
}
// Check if we have to search for dynamic categories.
var dynamicCategories []string
if catExprs := c.cfg.DynamicCategories(); len(catExprs) > 0 {