Identifiers: a pasted address with an unbalanced '[' in the host crashes the page with a 500 #460
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#460
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, readingcore/identifiers.pyand posting a malformed ORCID address to Your details.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atcore/identifiers.py:124(hosted_by) andcore/identifiers.py:132(value_from_url), reached fromScheme.normaliseatcore/identifiers.py:108. Of the callers,CompanyIdentifier.cleanis now atjobs/models.py:544,Company.by_identifieratjobs/models.py:470, the spreadsheet import's call atcore/csv_import.py:952, and_orcid_frommoved toplugins/europass/common.py:92(#248), from where both Europass readers use it; the other callers have not moved, and the same post to Your details still returns 500.Scheme.normaliselifts an identifier out of a pasted address throughhosted_byandvalue_from_url, and both callurllib.parse.urlsplit, which raisesValueError("Invalid IPv6 URL")when the host part has a[without its]. Every caller catches onlyValidationError, so the error escapes as a server error instead of the ordinary "That does not look like a … identifier" message.core/identifiers.py:119(hosted_by:host = (urlsplit(url).hostname or "").lower()) andcore/identifiers.py:127(value_from_url:parts = urlsplit(url)), reached fromScheme.normaliseatcore/identifiers.py:103. Callers that expect onlyValidationError:accounts/models.py:214(PersonIdentifier.clean, run by the profile form),jobs/models.py:541andjobs/services.py:29(company identifiers),jobs/models.py:467(Company.by_identifier, used byapplications/services.py:321,core/csv_import.py:957andcore/importer.py:569), andplugins/europass/reader.py:201(_orcid_from).https://[orcid.org/0000-0002-1825-0097returns 500 (reproduced with the test client). The same holds for the company schemes with URL paths (Wikidata, LinkedIn, LEI, Crunchbase, OpenCorporates), forcompany_wikidatasent to the listing and application API routes, for a Wikidata column in a spreadsheet import, for a backup archive's company identifiers, and for a Europass file whose websites include such an address:_orcid_fromcatchesValidationErroronly, so the whole import page fails.hosted_byandvalue_from_url, catchValueErroraroundurlsplitand answerFalseandNone, so the raw value falls through to the pattern check and is refused with the format message (and_orcid_fromsimply skips it).Done when
tests/test_person_identifiers.pyposts an ORCID row with an unbalanced[toaccounts:profileand gets the page back with the format error, andtests/test_identifiers.pyasserts thatcleanraisesValidationErrorforhttps://[wikidata.org/xunder the Wikidata scheme.