owasp-amass/amass · error

zero names provided in the Organization

Error message

zero names provided in the Organization

What it means

existsAndSharesLocEntity builds a list of candidate names (Name and LegalName) from an oamorg.Organization to search the graph for an existing matching org. If the Organization struct has neither a Name nor a LegalName set, there is nothing to match on, so the function refuses to proceed and returns this error instead of doing a meaningless graph query.

Source

Thrown at engine/plugins/support/org/find.go:154

				}
			}
		}
	}
	return nil, false
}

func existsAndSharesLocEntity(sess et.Session, obj *dbt.Entity, o *oamorg.Organization) (*dbt.Entity, error) {
	var names []string
	var locs []*dbt.Entity

	if o.Name != "" {
		names = append(names, o.Name)
	}
	if o.LegalName != "" {
		names = append(names, o.LegalName)
	}
	if len(names) == 0 {
		return nil, errors.New("zero names provided in the Organization")
	}

	ctx, cancel := context.WithTimeout(sess.Ctx(), 30*time.Second)
	defer cancel()

	if edges, err := sess.DB().OutgoingEdges(ctx, obj, time.Time{}, "legal_address", "hq_address", "location"); err == nil {
		for _, edge := range edges {
			if a, err := sess.DB().FindEntityById(ctx, edge.ToEntity.ID); err == nil && a != nil {
				if _, ok := a.Asset.(*oamcon.Location); ok {
					locs = append(locs, a)
				}
			}
		}
	}

	// get all locations that match the ones discovered on the graph
	locs = append(locs, matchingLocations(sess, locs)...)

View on GitHub (pinned to 79299dce87)

Solutions

  1. Populate o.Name (or at least o.LegalName) before invoking org lookup/creation APIs
  2. Trim and validate the name at data-ingestion time so empty strings never become an Organization
  3. Skip org-creation entirely when the source yields no usable organization name
  4. Check callers (createOrgInvestors, getOrganization, storeEntity, storeContact, store) to ensure they don't pass zero-value Organization structs

Example fix

// before
org := &oamorg.Organization{LegalName: ""}
CreateOrgAsset(sess, obj, rel, org, src)

// after
if org.Name == "" && org.LegalName == "" {
    return nil, fmt.Errorf("organization has no name; skipping")
}
CreateOrgAsset(sess, obj, rel, org, src)
Defensive patterns

Strategy: validation

Validate before calling

if o == nil || (o.Name == "" && o.LegalName == "") {
    return fmt.Errorf("organization must have a Name or LegalName before lookup")
}

Prevention

When it happens

Trigger: Calling CreateOrgAsset (or the dedup path it triggers via dedupChecks -> existsAndSharesLocEntity) with an Organization whose Name == "" and LegalName == "". Note CreateOrgAsset's own o.Name check rejects a missing Name, so this fires on the dedup path where LegalName was also empty but the empty-name org reached this helper, e.g. via FindOrg calls that skip the public validation.

Common situations: Constructing an Organization struct programmatically (from parsed RDAP/registration data) and forgetting to populate Name; data source returns an empty or whitespace name that gets stored as ""; unmarshalling JSON into Organization where the name key is misspelled or absent.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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