Flux Art — AI made simple, unleash your unlimited creativity
Multi-model AI visual creation and production platform · One account and workspace · Images, video, asset management and OpenAPI
Start Creating →
Flux Art › Blog › Guides › Pasted Asset Links: …

Pasted Asset Links: Parse First, Then Allow Protocols

Anonymous community contributor (alias): Paper Moon Old Album Published: Category:Guides

Displayable text is not automatically a suitable link

When organizing Flux Art assets, a custom review tool might let colleagues paste reference URLs and automatically show an Open original link. Text can be stored as a note without being suitable for unchecked browser navigation. Define the supported link purposes first, then parse the address and verify its protocol and destination. This article concerns link admission in custom pages. It does not perform server-side image fetching or treat successful parsing as proof of a safe destination or confirmed asset rights.

Decide whether relative URLs are accepted

If the workflow needs only external public references, it can explicitly require complete HTTPS URLs. If relative paths are allowed, specify a trusted base and explain which page or resource root they resolve against. Do not use a user-controlled base or treat simple string concatenation as parsing. Redact sensitive values when retaining original input for necessary traceability, and record the normalized address actually intended for navigation so that the displayed destination does not differ from the one used on a click.

Successful parsing still needs a business decision

MDN's URL constructor documentation explains that failure to form a valid URL throws TypeError and relative references require a base. Resolving against a base is not ordinary string concatenation. See https://developer.mozilla.org/en-US/docs/Web/API/URL/URL . The following is a hypothetical admission table, not a real security test. Catch parsing errors and give a clear message. After parsing succeeds, check the protocol and permitted business destinations; returning a URL object is not permission for every navigation use.

Input caseDecision basisUI handling
Complete public URLParsed result and allowed protocolMake clickable only after approval
Relative referenceAn explicit, trusted baseRequest a complete URL if unsupported
Malformed inputConstructor parsing failureRetain non-clickable text
Disallowed protocolStructured protocol valueExplain the rejection
Restricted asset domainNormalized host or originDo not allow out-of-scope destinations
Unresolved destinationUnknown business purpose or permissionMark as awaiting evidence

Match the protocol allowlist to the actual purpose

For an entry point used only for public web references, HTTPS can be the explicit allowed protocol, with other protocols rejected according to the business design rather than a scattered blacklist of dangerous words. Data, blob, email and local-file forms each have uses, but support elsewhere is not a reason to enable all of them here. Check structured properties such as the parsed protocol instead of looking for a word in the original string. This is defensive design guidance, not executable test payloads or a recommendation to try untrusted protocols in production.

Express destination restrictions precisely

If links must point only to registered asset domains, compare the parsed, normalized host or origin and define port and subdomain rules. Do not replace matching with a test for whether a string contains a name, and do not let text in the user-information component or path influence the host decision. HTTPS approval establishes only that the protocol meets the rule, not that the destination is within business scope. If arbitrary public reference sites are allowed, label them honestly as external instead of using platform branding to imply a trusted destination.

Handle display text and the navigation address separately

The link label can display the user's note as plain text, while href receives only the parsed result approved under this entry point's rules. Do not concatenate the entire input into HTML and rely on visual inspection for safety. If parsing or admission fails, retain non-clickable text with an explanation. Recheck after editing instead of keeping an earlier approval badge. When a target URL includes an access signature, do not expose it in full in public lists, logs or error screenshots. Permission to navigate is not permission to share publicly.

Check the rules with harmless boundary examples

Suppose a test set includes complete HTTPS URLs, relative paths resolved under the agreed rules, malformed text and protocol forms this entry point does not allow. This is a hypothetical acceptance plan, not a real attack. Record the original input type, parsed protocol and host, reason for allowing or rejecting it, and whether the final UI is clickable. Also test edits to existing records and reloading historical data to find older paths that skip the checks. Use only controlled public test addresses, not internal networks or third-party private resources.

Do not turn a frontend link check into permission to fetch

If a later feature fetches images through a server, design server-side destination restrictions, resolution and network boundaries separately. Browser href rules do not replace SSRF defenses. Redirects after a click may also change the final destination. A task requiring a fixed source needs an appropriately controlled process; approval of the initial URL cannot guarantee every later page. Leave unknown destinations awaiting evidence and perform checks only in authorized environments. Asset troubleshooting does not justify indefinitely following arbitrary addresses.

Hand over the rule version and rejection reasons

Deliver the entry point's purpose, base rules, allowed protocols, host scope, display behavior and boundary-test results, tied to the actual component version. The technical references were checked on November 10, 2026; no security testing was performed on the reader's system. Start creating with Flux Art at https://flux-art.net/en and find integration information at https://flux-art.net/en/openapi . Platform asset generation, custom link display and server-side resource retrieval are separate stages. Checking each makes it clear which addresses are usable and which still need confirmation.

Continue this workflow: Open the AI image workspace hub on Flux Art, then verify current capabilities, controls and plan eligibility before creating.

Open the AI image workspace →

Frequently Asked Questions

Q: Is a URL safe if parsing succeeds?

A: No. Parsing only establishes an address object. Protocol, destination purpose, permission and content trust still require separate decisions.

Q: Why not just check the start of the string?

A: The original string and parsed structure may differ. Check protocol and host through standard parsing instead of inferring the whole meaning from a few prefixes.

Q: Must relative URLs always be rejected?

A: That depends on the entry point. If allowed, they need an explicit trusted base and tests, not an implicit arbitrary base controlled by the user.

Q: Is every HTTPS address safe to click?

A: HTTPS does not establish trustworthy content or business approval. Define host restrictions and external-link notices separately.

Q: Can the note and href share one HTML string?

A: Avoid concatenating user input into HTML. Display the note as plain text and use a separately approved navigation result rather than mixing the two contexts.

Q: May the server fetch a URL after it passes frontend checks?

A: That cannot be inferred. Server-side fetching has separate destination and network-access boundaries requiring dedicated protection and authorization.

Q: Does an edited historical record need another check?

A: Yes. Approval must match the actual address and rule version. Do not retain an old pass status while changing the destination.

Q: Should rejected links cause the source material to be deleted?

A: Rejecting navigation need not mean deleting material. Keep a non-clickable explanation and redacted reason, and handle the original record under the asset retention rules.