projectdiscovery/katana · info
result does not match extension filter
Error message
result does not match extension filter
What it means
StandardWriter.Write returns this when the result's request URL fails the extension validator (w.extensionValidator.ValidatePath). Katana only emits results whose URL extension passes the configured extension match/filter rules; anything else is rejected at the output stage.
Source
Thrown at pkg/output/output.go:193
}
// Write writes the result to file and/or screen.
func (w *StandardWriter) Write(result *Result) error {
if result == nil {
return errors.New("result is nil")
}
// Skip empty responses (e.g., from similarity filtering)
if result.Response != nil && result.Response.Resp == nil && result.Response.Body == "" && result.Error == "" {
return errors.New("response filtered by similarity detection")
}
if len(w.storeFields) > 0 {
storeFields(result, w.storeFields)
}
if !w.extensionValidator.ValidatePath(result.Request.URL) {
return errors.New("result does not match extension filter")
}
if !w.matchOutput(result) {
return errors.New("result does not match output")
}
if w.filterOutput(result) {
return errors.New("result is filtered out")
}
if len(w.filterPageType) > 0 && result.Response != nil && result.Response.KnowledgeBase != nil {
if pageType, ok := result.Response.KnowledgeBase["PageType"].(string); ok {
for _, ft := range w.filterPageType {
if strings.EqualFold(pageType, ft) {
return errors.New("result filtered by page type")
}
}
}
}
var data []byteView on GitHub (pinned to e3e742739c)
Solutions
- Review the extension filter configuration (-ef / extension match options) and remove or broaden it so the URL in question passes.
- Pre-validate the URL extension in your own code before calling Write and skip non-matching results.
- Confirm the URL is correct — an unexpected path (e.g. a redirect to a filtered asset) is often the cause.
- Implement a custom writer/validator if you need different extension semantics.
Example fix
// before
for _, res := range results {
_ = writer.Write(res) // fails for .jpg URLs when -ef jpg set
}
// after
for _, res := range results {
if !allowedExtension(res.Request.URL) {
continue
}
if err := writer.Write(res); err != nil {
return err
}
} Defensive patterns
Strategy: validation
Validate before calling
func matchesExtensionFilter(rawURL string, allowed, excluded []string) bool {
ext := strings.ToLower(path.Ext(rawURL))
if slices.Contains(excluded, strings.TrimPrefix(ext, ".")) { return false }
if len(allowed) > 0 && !slices.Contains(allowed, strings.TrimPrefix(ext, ".")) { return false }
return true
} Try / catch
if err := writer.Write(result); err != nil {
if err.Error() == "result does not match extension filter" {
log.Debugf("skipped by extension filter: %s", result.Request.URL)
return nil
}
return err
} Prevention
- Audit -ef / extension filter flags before long crawls
- Pre-filter URLs by extension in your own pipeline
- Log skipped URLs at debug level to catch overly broad filters
When it happens
Trigger: Calling Write(result) when result.Request.URL has a file extension excluded by -ef (extension filter) or not included by the extension match configuration, so extensionValidator.ValidatePath returns false.
Common situations: Crawling with extension filters configured (e.g. -ef png,jpg,css) while feeding results into a custom writer; URLs ending in filtered extensions like .jpg or .zip reaching the output pipeline; misconfigured extension list that unintentionally excludes wanted extensions.
Related errors
- response filtered by similarity detection
- result does not match output
- result is filtered out
- result filtered by page type
- result is empty
AI-assisted analysis of projectdiscovery/katana@e3e742739c (2026-09-03).
Data as JSON: /api/errors/13b36691ff97c6db.
Report an issue: GitHub.