owasp-amass/amass · error

failed to extract the FQDN asset

Error message

failed to extract the FQDN asset

What it means

The Bing scraping plugin's check() asserts e.Entity.Asset to *oamdns.FQDN before scraping search results for subdomains. If the event's asset is not an FQDN, the assertion fails and this error is returned. The event filter allowed a non-FQDN entity into the scraper.

Source

Thrown at engine/plugins/scrape/bing.go:78

		Transforms:   []string{string(oam.FQDN)},
		EventType:    oam.FQDN,
		Callback:     b.check,
	}); err != nil {
		return err
	}

	b.log.Info("Plugin started")
	return nil
}

func (b *bing) Stop() {
	b.log.Info("Plugin stopped")
}

func (b *bing) check(e *et.Event) error {
	fqdn, ok := e.Entity.Asset.(*oamdns.FQDN)
	if !ok {
		return errors.New("failed to extract the FQDN asset")
	}

	if !support.HasSLDInScope(e) {
		return nil
	}

	since, err := support.TTLStartTime(e.Session.Config(), string(oam.FQDN), string(oam.FQDN), b.name)
	if err != nil {
		return err
	}

	var names []*dbt.Entity
	if !support.AssetMonitoredWithinTTL(e.Session, e.Entity, b.source, since) {
		names = append(names, b.query(e, fqdn.Name)...)
		support.MarkAssetMonitored(e.Session, e.Entity, b.source)
	}

	if len(names) > 0 {

View on GitHub (pinned to 79299dce87)

Solutions

  1. Return nil instead of an error on cast failure so non-FQDN events are skipped
  2. Filter the subscription so only FQDN events invoke check()
  3. Confirm upstream emitters wrap domain names in *oamdns.FQDN

Example fix

// before
fqdn, ok := e.Entity.Asset.(*oamdns.FQDN)
if !ok {
	return errors.New("failed to extract the FQDN asset")
}

// after
fqdn, ok := e.Entity.Asset.(*oamdns.FQDN)
if !ok {
	return nil
}
Defensive patterns

Strategy: type-guard

Validate before calling

if _, ok := e.Entity.Asset.(*oamdns.FQDN); !ok {
	return nil
}

Type guard

func eventFQDN(e *et.Event) (*oamdns.FQDN, bool) {
	f, ok := e.Entity.Asset.(*oamdns.FQDN)
	return f, ok
}

Try / catch

if err := b.check(ev); err != nil {
	if strings.Contains(err.Error(), "failed to extract the FQDN") {
		continue // not an FQDN; skip scraping
	}
	log.Error(err)
}

Prevention

When it happens

Trigger: Events whose asset is not *oamdns.FQDN (URLs, IPs, certificates, etc.) reach bing.check because the subscription topic matches them.

Common situations: Scraping plugins subscribed to overly broad event topics; upstream emitting alternative domain asset types; plugin wiring errors in custom builds.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of owasp-amass/amass@79299dce87 (2026-09-06). Data as JSON: /api/errors/12704dcbdde138b9. Report an issue: GitHub.