linkedin-search detail fetches whatever posting carries the digits in a URL on any other host (no host check in normalizeId)

Author: ayobamiseunCreated Sep 25, 2026Updated Sep 25, 2026

Line references against master @ 120f476.

Summary

linkedin-search detail accepts a URL on any host and fetches whatever LinkedIn posting carries the first 6+-digit path segment. normalizeId (.agents/skills/linkedin-search/cli/src/commands/detail.ts:9-17) has no host check: after the URN and bare-id branches it runs input.match(/-(\d{6,})(?:[\/?]|$)/) || input.match(/\/(\d{6,})(?:[\/?]|$)/) on the raw string. A Greenhouse or Lever apply link - the kind a posting's own page hands out, and what a user pastes back into detail - is reduced to its numeric segment and the handler requests jobPosting/<that number>.

Reproduction (network-free)

Drive the real exported handler with a fetch stub that records the URL and answers 404:

typescript
import { runDetail } from ".agents/skills/linkedin-search/cli/src/commands/detail.ts"
const requested: string[] = []
globalThis.fetch = (async (u: string | URL | Request) => { requested.push(String(u)); return new Response("", { status: 404 }) }) as any
await runDetail({ id: "https://boards.greenhouse.io/acme/jobs/4567890", format: "json" })
console.log(requested)
input request made on master
https://boards.greenhouse.io/acme/jobs/4567890 https://www.linkedin.com/jobs-guest/jobs/api/jobPosting/4567890
https://jobs.lever.co/acme/1234567 .../jobPosting/1234567
https://www.linkedin.com/jobs/view/4567890 .../jobPosting/4567890 (correct)

With a live LinkedIn, the first two return whichever posting carries that id, printed with exit 0, or NOT_FOUND if none does - never an error about the input. normalizeId("https://boards.greenhouse.io/acme/jobs/4567890") returns "4567890".

Why it matters

/apply and /rank agents feed detail stored URLs; a user pastes apply links from postings. Every other portal CLI rejects an off-host detail URL with BAD_ID and constructs its fetch URL from the extracted id (#447 established the shape for jobindex; jobbank, jobdanmark, jobnet followed in #430). linkedin is the one CLI still trusting the digits, and unlike a NOT_FOUND, a successful wrong posting is silent.

Fix

Parse the URL for real: require a linkedin.com host (apex or any subdomain, scheme optional) and a /jobs/view/<slug->id path; reject other hosts, look-alike hosts (linkedin.com.evil.io), userinfo tricks ([email protected]), and non-job linkedin.com URLs with the existing BAD_ID error before any request. Bare ids, URNs, and slash-free title slugs unchanged. PR follows.

Source: MadsLorentzen/ai-job-search