{"record":{"id":"12d6ac28a7e6cfbe","repo":"santifer/career-ops","slug":"landingjobs-untrusted-hostname-parsed-hostname","errorCode":null,"errorMessage":"landingjobs: untrusted hostname \"${parsed.hostname}\" — must be ${TRUSTED_HOST}","messagePattern":"landingjobs: untrusted hostname \"(.+?)\" — must be (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/landingjobs.mjs","lineNumber":30,"sourceCode":"// `company` is derived best-effort from that slug (humanized) and falls back to\n// the portal entry name. The whole active set is returned in one call.\n//\n// Wire in via a `job_boards:` entry with `provider: landingjobs`.\n\nconst FEED_URL = 'https://landing.jobs/api/v1/jobs';\nconst TRUSTED_HOST = 'landing.jobs';\n\n/** @param {string} url */\nfunction assertLandingUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`landingjobs: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`landingjobs: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`landingjobs: untrusted hostname \"${parsed.hostname}\" — must be ${TRUSTED_HOST}`);\n  }\n  return url;\n}\n\n// NaN-safe Date.parse.\nfunction toEpochMs(value) {\n  if (typeof value !== 'string' || !value) return undefined;\n  const parsed = Date.parse(value);\n  return Number.isNaN(parsed) ? undefined : parsed;\n}\n\n/**\n * Derive a best-effort company name from a Landing.jobs posting URL.\n * Posting URLs are `https://landing.jobs/at/<slug>/<job>`; the `<slug>` is\n * humanized (hyphens/underscores → spaces, title-cased). Returns '' when the\n * URL is not the expected `/at/<slug>/…` shape. Exported for unit tests.\n * @param {string} url\n */","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/landingjobs.mjs#L12-L48","documentation":"Thrown by assertLandingUrl() when the parsed URL's hostname is not exactly 'landing.jobs' (TRUSTED_HOST). The provider hard-pins the single trusted host and refuses any other hostname to prevent SSRF via redirect or a tampered entry pointing at an internal or attacker-controlled server. Note www.landing.jobs or any subdomain is also rejected since the check is an exact match.","triggerScenarios":"An api/careers_url pointing at a different domain (www.landing.jobs, a proxy, an internal IP, a lookalike); a CNAME or vanity domain not equal to landing.jobs; using the landingjobs provider for a non-landing.jobs board.","commonSituations":"A www-prefixed URL the user assumed was equivalent; pointing the provider at a proxy/mirror; selecting the wrong provider for a board that isn't landing.jobs.","solutions":["Use the canonical host landing.jobs (drop any www or subdomain prefix).","If the company is not on landing.jobs, switch the entry's provider to the correct ATS.","Confirm the URL is https://landing.jobs/... with no subdomain."],"exampleFix":"# before\nacme:\n  provider: landingjobs\n  api: https://www.landing.jobs/api/v1/jobs\n\n# after\nacme:\n  provider: landingjobs\n  api: https://landing.jobs/api/v1/jobs","handlingStrategy":"validation","validationCode":"function isTrustedLandingHost(url) {\n  try { return new URL(url).hostname === 'landing.jobs'; } catch { return false; }\n}","typeGuard":"/** @param {string} url @returns {boolean} */\nfunction isLandingJobsHttpsUrl(url) {\n  try {\n    const p = new URL(url);\n    return p.protocol === 'https:' && p.hostname === 'landing.jobs';\n  } catch { return false; }\n}","tryCatchPattern":null,"preventionTips":["Use the exact host landing.jobs — no www or subdomain.","If a company is not on landing.jobs, do not use the landingjobs provider.","Lint entries against the provider's trusted-host set."],"tags":["landingjobs","ssrf-guard","hostname-allowlist","config"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}