owasp-amass/amass · error
invalid asset type
Error message
invalid asset type
What it means
defaultContentFilter maps each supported oam.Asset type to its database content filter key. When the asset's concrete type does not match any known case (e.g. falls through the switch), the function returns this error, so the asset cannot be stored with a content filter.
Source
Thrown at engine/api/server/v1/utils.go:269
case oam.Organization:
return dbt.ContentFilters{"unique_id": asset.Key()}, nil
case oam.Person:
return dbt.ContentFilters{"unique_id": asset.Key()}, nil
case oam.Phone:
return dbt.ContentFilters{"e164": asset.Key()}, nil
case oam.Product:
return dbt.ContentFilters{"unique_id": asset.Key()}, nil
case oam.ProductRelease:
return dbt.ContentFilters{"name": asset.Key()}, nil
case oam.Service:
return dbt.ContentFilters{"unique_id": asset.Key()}, nil
case oam.TLSCertificate:
return dbt.ContentFilters{"serial_number": asset.Key()}, nil
case oam.URL:
return dbt.ContentFilters{"url": asset.Key()}, nil
}
return nil, errors.New("invalid asset type")
}
View on GitHub (pinned to 79299dce87)
Solutions
- Identify the asset type being passed and add a case for it in defaultContentFilter with the correct content filter key
- Upgrade to a version where the asset type is supported
- Filter out unsupported asset types in the plugin before submitting via PutAsset
Example fix
// before
return nil, errors.New("invalid asset type")
// after
case oam.NewIPAddress(net.IPv4zero): // add the missing case
return dbt.ContentFilters{"address": asset.Key()}, nil Defensive patterns
Strategy: validation
Validate before calling
switch a.(type) {
case *oam.TLSCertificate, *oam.URL: // supported types
default:
return fmt.Errorf("asset type %T not supported for content filter", a)
} Type guard
func isSupportedAsset(a oam.Asset) bool {
switch a.(type) {
case *oam.TLSCertificate, *oam.URL:
return true
}
return false
} Try / catch
err := sess.PutAsset(asset)
if err != nil && strings.Contains(err.Error(), "invalid asset type") {
// skip unsupported asset and continue
return nil
} Prevention
- Only submit asset types known to be handled by the server switch
- After adding a new oam asset type, update defaultContentFilter immediately
- Skip-and-log unsupported assets in plugins instead of failing the pipeline
When it happens
Trigger: PutAsset is called with an asset whose concrete oam type is not handled by the switch in defaultContentFilter (a type without a case like oam.TLSCertificate or oam.URL).
Common situations: A newly added oam asset type in a newer version whose filter mapping was not yet added; a plugin emitting a custom/unsupported asset type; type assertion producing an unexpected asset variant.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- brute forcing cannot be performed without DNS resolution
- active enumeration cannot be performed without DNS resolutio
- resolvers section is not a list
- no valid resolvers were found
- zero decoded assets
AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06).
Data as JSON: /api/errors/07959aef4a893f9c.
Report an issue: GitHub.