Join our Newsletter — 33% off our NHI Course

How does a universal resource identifier work?

A universal resource identifier is a string used to identify a resource, either by location, name or both. It is the broader concept behind addresses such as URLs and can appear in security controls, logs and application inputs. Practitioners should validate and normalise URIs carefully, because malicious encoding or unusual schemes can bypass checks.

How a URI is structured and why it matters

A URI is a general identifier, not always a network address. It can identify something by name, by location, or by both, which is why URLs are only one kind of URI. The scheme at the front tells software how to interpret the rest of the string, while the authority, path, query, and fragment provide the specific target or context.

That structure is useful because different applications consume URIs in different ways. A browser may resolve a web URI, an API client may use one to reach a service endpoint, and an application may store or compare it as an identifier. The same string can therefore be a locator, a lookup key, or an input that drives security decisions.

Why validation and normalisation are part of the answer

URI handling becomes security-sensitive when software assumes a URI is simple text. Encoding tricks, case differences, path traversal patterns, userinfo fields, and unusual or unexpected schemes can make two strings look different while still resolving in ways the application did not intend. Validation should happen against a strict allowlist of expected schemes and formats, not just against a visible string pattern.

Normalisation matters because downstream components may parse the same URI differently. If one layer decodes a character sequence before checking it and another layer decodes it again before use, a malicious input may slip past the first control and still reach a sensitive destination. For that reason, the safest approach is to normalise once, validate against the canonical form, and reject anything ambiguous.

URI comparison also needs care. Small variations such as trailing slashes, percent-encoding, dot segments, and internationalised hostnames can affect whether a resource is treated as the same object or a different one. When a URI is used in access control, redirect handling, callback registration, or allowlists, those comparison rules need to be explicit and consistent.

Where URI handling fails in real systems

URI parsing bugs often appear where one component trusts another component’s interpretation. That can lead to open redirect flaws, server-side request forgery, bypasses of host or path allowlists, and input filters that fail on encoded values or edge-case syntax. In practice, the risk is not the string itself, but the mismatch between what the user supplied and what the application actually retrieves or authorises.

It is also easy to over-accept valid syntax and under-validate semantics. A URI may be syntactically correct while still pointing to an internal service, a dangerous scheme, or a resource outside the intended trust boundary. When URI data is passed into network clients, identity flows, or policy engines, the trust boundary is the important part, not just the grammar.

For web-facing systems, URI-centric controls often sit near other authorization logic. An API may accept a URI that names a protected resource, a redirect endpoint, or a callback target. If the application does not bind that value to an expected tenant, domain, or resource class, the URI can become a path around intended control rather than a harmless identifier. OWASP API Security Top 10 is useful background where URI input affects API access decisions and resource targeting.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 addresses the attack and risk surface, while OWASP ASVS, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP ASVS V4 — API and Web Service URIs often feed API endpoints, redirects, and resource targeting.
Recommendation — Validate and canonicalise URI inputs before using them in API requests or trust decisions.
OWASP API Security Top 10 API8 — Security Misconfiguration URI parsing and routing errors can create exposed or misrouted endpoints.
Recommendation — Harden routing and allowlists so malformed or unexpected URIs cannot alter request handling.
NIST SP 800-53 Rev 5 SI-10 — Information Input Validation URI strings are application inputs that need strict validation and canonicalisation.
SC-7 — Boundary Protection URI misuse can cross trust boundaries and reach internal or unintended resources.
Recommendation — Apply input-validation controls to reject malformed, encoded, or unexpected URI values. Enforce boundary checks before URI-driven requests leave the trusted environment.
CIS Controls v8 CIS-16 — Application Software Security Secure URI parsing belongs in application security review and test coverage.
Recommendation — Test URI handling for parser differentials, redirects, and allowlist bypasses.

Practitioner Guidance

What to verify: Confirm the application treats URI input as structured data, not opaque text. Check whether parsing, decoding, comparison, and policy enforcement all use the same canonical representation, especially before redirect, fetch, or authorisation decisions.

Decision rule: If the URI can influence network access, privilege, or trust boundaries, validate it against an allowlist of expected schemes, hosts, and paths before any downstream use. If the value is only being displayed or stored, the control can be lighter, but it still needs canonicalisation to avoid inconsistent matching.

Common mistake: Filtering on a raw string and assuming that blocks the resolved destination. Many failures come from validating the visible text while the runtime later interprets encoded characters, alternate schemes, or parser edge cases differently.

What good looks like: The application rejects ambiguous or unexpected URIs early, logs the normalised form, and uses one parsing library or policy path consistently across the stack. That makes it far easier to explain why a request was accepted or denied.

Practitioner takeaway: Treat URI handling as a parsing and trust-boundary problem, not just an input-format problem. The safest control is to reduce the set of acceptable URI forms, normalise before use, and make every security decision on the canonical value.