{"record":{"id":"72d229e4267b734c","repo":"santifer/career-ops","slug":"bamboohr-url-must-use-https-url","errorCode":null,"errorMessage":"bamboohr: URL must use HTTPS: ${url}","messagePattern":"bamboohr: URL must use HTTPS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/bamboohr.mjs","lineNumber":25,"sourceCode":"// match on `<safe-tenant>.bamboohr.com` rather than a static allowlist\n// (same approach as the recruitee provider).\n//\n// The list endpoint (`/careers/list`) returns lightweight metadata — enough for\n// the Job contract (title, url, location) at zero token cost. The full JD lives\n// behind a second `/careers/<id>/detail` request, which the scanner deliberately\n// skips to stay zero-token (so `description`/`postedAt` are omitted).\n\nconst BAMBOOHR_HOST_RE = /^[a-z0-9][a-z0-9-]*\\.bamboohr\\.com$/;\n\n/** @param {string} url */\nfunction assertBambooHRUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`bamboohr: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`bamboohr: URL must use HTTPS: ${url}`);\n  if (!BAMBOOHR_HOST_RE.test(parsed.hostname)) {\n    throw new Error(`bamboohr: untrusted hostname \"${parsed.hostname}\" — must match <tenant>.bamboohr.com`);\n  }\n  return url;\n}\n\n/**\n * Resolve the tenant origin (`https://<tenant>.bamboohr.com`) from an entry.\n * Honours an explicit `api:` URL, else parses `careers_url`.\n * @param {import('./_types.js').PortalEntry} entry\n * @returns {string | null}\n */\nfunction resolveOrigin(entry) {\n  const rawApi = typeof entry.api === 'string' ? entry.api : '';\n  const rawCareers = typeof entry.careers_url === 'string' ? entry.careers_url : '';\n  const raw = (rawApi || rawCareers).trim();\n  if (!raw) return null;\n  let parsed;","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/bamboohr.mjs#L7-L43","documentation":"The HTTPS-enforcement step of BambooHR's SSRF guard. After the URL parses, any scheme other than `https:` is rejected, enforcing transport security to the BambooHR tenant.","triggerScenarios":"`parsed.protocol !== 'https:'` for a URL that otherwise parses — typically an `http://<tenant>.bamboohr.com` value.","commonSituations":"A careers_url copied from an insecure source, a local proxy URL left in config, or a tool that downgraded the scheme.","solutions":["Use `https://<tenant>.bamboohr.com` for both `api:` and `careers_url`.","Remove http:// overrides from config/environment.","Terminate TLS on any local test proxy instead of weakening the check."],"exampleFix":"# before\n- name: Acme\n  api: http://acme.bamboohr.com\n\n# after\n- name: Acme\n  api: https://acme.bamboohr.com","handlingStrategy":"validation","validationCode":"function ensureHttpsField(entry, field) {\n  if (!entry[field]) return;\n  if (new URL(entry[field]).protocol !== 'https:') {\n    throw new Error(`bamboohr: ${field} must be https: ${entry[field]}`);\n  }\n}\nensureHttpsField(entry, 'api');\nensureHttpsField(entry, 'careers_url');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize provider URLs to https at config load.","Reject http:// values with a startup error.","Terminate TLS on local test proxies rather than disabling the check."],"tags":["bamboohr","url-validation","https","ssrf"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}