{"record":{"id":"423b84803f4f258e","repo":"santifer/career-ops","slug":"eightfold-url-must-use-https-url","errorCode":null,"errorMessage":"eightfold: URL must use HTTPS: ${url}","messagePattern":"eightfold: URL must use HTTPS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"providers/eightfold.mjs","lineNumber":71,"sourceCode":"// Eightfold's edge rate-limits bursts, and a 616-job board is 62 requests.\nconst INTER_PAGE_DELAY_MS = 150;\n\nconst RETRY_POLICY = { retries: 3, baseDelayMs: 500, maxDelayMs: 8_000 };\n\n/**\n * SSRF guard — every request URL passes through here before it is fetched.\n *\n * @param {string} url\n * @returns {string} the same URL, when it is a trusted Eightfold endpoint.\n */\nfunction assertEightfoldUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`eightfold: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`eightfold: URL must use HTTPS: ${url}`);\n  if (!EIGHTFOLD_HOST_RE.test(parsed.hostname)) {\n    throw new Error(`eightfold: untrusted hostname \"${parsed.hostname}\" — must match *.eightfold.ai`);\n  }\n  return url;\n}\n\n/** @param {number} ms @param {any} ctx */\nfunction sleep(ms, ctx) {\n  if (typeof ctx?.sleep === 'function') return ctx.sleep(ms);\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Eightfold reports timestamps as epoch SECONDS (`t_create`, `t_update`), not\n * the ISO strings every other provider gets. Converted here; anything\n * non-finite or non-positive is dropped rather than guessed at.\n *\n * @param {unknown} value","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/eightfold.mjs#L53-L89","documentation":"Thrown by eightfold's assertEightfoldUrl when the URL parses but is not https. Defense-in-depth: buildApiUrl always constructs the URL with a literal 'https://' prefix, so the protocol is always https and this branch is unreachable through normal fetch() use. Reachable only via a direct assertEightfoldUrl call on an http URL.","triggerScenarios":"assertEightfoldUrl is called directly with a well-formed http:// URL. No entry config or fetch() path produces this.","commonSituations":"A direct integration or test passing an http URL to the guard. Production scans cannot reach this branch.","solutions":["For direct callers, pass only https URLs.","For normal fetch() use, no action — buildApiUrl hard-codes https.","Investigate if seen in production: buildApiUrl was changed."],"exampleFix":"// before\nassertEightfoldUrl('http://bayer.eightfold.ai/api/apply/v2/jobs?start=0&num=10');\n\n// after\nassertEightfoldUrl('https://bayer.eightfold.ai/api/apply/v2/jobs?start=0&num=10');","handlingStrategy":"validation","validationCode":"function isHttpsUrl(u) { try { return new URL(u).protocol === 'https:'; } catch { return false; } }","typeGuard":"function isHttpsUrl(u) {\n  if (typeof u !== 'string' || !u) return false;\n  try { return new URL(u).protocol === 'https:'; } catch { return false; }\n}","tryCatchPattern":"try { assertEightfoldUrl(url); }\ncatch (e) {\n  if (/^eightfold: URL must use HTTPS/.test(e.message)) { /* upgrade to https or skip */ }\n  else throw e;\n}","preventionTips":["No action for normal scans — buildApiUrl hard-codes https.","For direct calls, normalise to https.","Reject http at config time."],"tags":["url-validation","eightfold","ssrf","tls","defense-in-depth"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}