layershifter/tld-database
A PHP package providing an up-to-date database of top-level domains, with tools to parse domain names, extract and validate TLDs, and refresh the TLD list from IANA. Useful for domain validation, normalization, and routing logic.
\.([a-z]{2,})$), which rejects example.co.uk or accepts foo.invalidtld.tenant.example.com vs. the registrable domain, deriving per-customer rate-limit and cache keys, segmenting analytics by customer, and routing wildcard subdomains. This is where the package's value is concentrated.co.uk or github.io as a registrable domain; relevant to session-fixation, open-redirect, and SSRF review findings.composer.json, this assessment supports a deprioritize-vs-schedule-migration call: the risk is stale suffix data (all gTLDs and IDN changes since 2019 are missing), not exploitability of the code itself.Consider it only in these narrow cases:
Look elsewhere (or build) if any of the following hold:
composer require.composer audit cleanliness, or an actively patched data feed.Alternatives to evaluate in a spike: a maintained PSL parser such as pdp/pdp (PHP Domain Parser), the same author's layer-shifter/tld-extract for extraction-only use, or vendoring the official PSL file with a scheduled refresh job plus a thin matcher (~200 LOC) — often the most durable option because the data and the code age independently. Validate whichever you pick against a fixture set of co.uk, github.io, s3.amazonaws.com, punycode hosts, and a post-2019 gTLD.
To executives (one paragraph): We evaluated layershifter/tld-database as a way to get correct domain handling — the logic behind tenant subdomains, cookie scoping, and validating customer-supplied URLs. Recommendation: do not adopt. The package is explicitly deprecated, the repository is archived, it has zero dependents, and its Public Suffix List data has been frozen since August 2019, meaning it will misclassify every top-level domain added or changed in the last several years. The cost of adoption looks like zero (Apache-2.0, small footprint) but the real cost is a silent correctness and security gap in exactly the places where domains matter — multi-tenant isolation and host allowlists. If it already exists in our codebase, treat it as tracked technical debt with a scoped migration, not as a building block for new work.
To engineering (summary): Small, clean, Apache-2.0 abstraction over the PSL with a Laravel-friendly surface — but it is a dead branch. Do not add it to new services. Where it exists, replace it with either pdp/pdp (maintained, current data) or an in-house matcher over a vendored PSL file with a scheduled refresh, and pin the decision with a conformance fixture suite covering multi-label suffixes, private-section domains, and IDNs. Budget roughly a day for the swap plus test coverage; the risk being retired is stale-data misclassification in cookie scoping and tenant routing, not a CVE.
How can I help you explore Laravel packages today?