santifer/career-ops · error · Error

bamboohr: URL must use HTTPS: ${url}

Error message

bamboohr: URL must use HTTPS: ${url}

What it means

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.

Source

Thrown at providers/bamboohr.mjs:25

// match on `<safe-tenant>.bamboohr.com` rather than a static allowlist
// (same approach as the recruitee provider).
//
// The list endpoint (`/careers/list`) returns lightweight metadata — enough for
// the Job contract (title, url, location) at zero token cost. The full JD lives
// behind a second `/careers/<id>/detail` request, which the scanner deliberately
// skips to stay zero-token (so `description`/`postedAt` are omitted).

const BAMBOOHR_HOST_RE = /^[a-z0-9][a-z0-9-]*\.bamboohr\.com$/;

/** @param {string} url */
function assertBambooHRUrl(url) {
  let parsed;
  try {
    parsed = new URL(url);
  } catch {
    throw new Error(`bamboohr: invalid URL: ${url}`);
  }
  if (parsed.protocol !== 'https:') throw new Error(`bamboohr: URL must use HTTPS: ${url}`);
  if (!BAMBOOHR_HOST_RE.test(parsed.hostname)) {
    throw new Error(`bamboohr: untrusted hostname "${parsed.hostname}" — must match <tenant>.bamboohr.com`);
  }
  return url;
}

/**
 * Resolve the tenant origin (`https://<tenant>.bamboohr.com`) from an entry.
 * Honours an explicit `api:` URL, else parses `careers_url`.
 * @param {import('./_types.js').PortalEntry} entry
 * @returns {string | null}
 */
function resolveOrigin(entry) {
  const rawApi = typeof entry.api === 'string' ? entry.api : '';
  const rawCareers = typeof entry.careers_url === 'string' ? entry.careers_url : '';
  const raw = (rawApi || rawCareers).trim();
  if (!raw) return null;
  let parsed;

View on GitHub (pinned to 9b17a8ac97)

Solutions

  1. Use `https://<tenant>.bamboohr.com` for both `api:` and `careers_url`.
  2. Remove http:// overrides from config/environment.
  3. Terminate TLS on any local test proxy instead of weakening the check.

Example fix

# before
- name: Acme
  api: http://acme.bamboohr.com

# after
- name: Acme
  api: https://acme.bamboohr.com
Defensive patterns

Strategy: validation

Validate before calling

function ensureHttpsField(entry, field) {
  if (!entry[field]) return;
  if (new URL(entry[field]).protocol !== 'https:') {
    throw new Error(`bamboohr: ${field} must be https: ${entry[field]}`);
  }
}
ensureHttpsField(entry, 'api');
ensureHttpsField(entry, 'careers_url');

Prevention

When it happens

Trigger: `parsed.protocol !== 'https:'` for a URL that otherwise parses — typically an `http://<tenant>.bamboohr.com` value.

Common situations: A careers_url copied from an insecure source, a local proxy URL left in config, or a tool that downgraded the scheme.

Related errors


AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13). Data as JSON: /api/errors/72d229e4267b734c. Report an issue: GitHub.