santifer/career-ops · error · Error
getonbrd: untrusted hostname "${parsed.hostname}" — must be
Error message
getonbrd: untrusted hostname "${parsed.hostname}" — must be ${TRUSTED_HOST} What it means
getonbrd.mjs throws this in assertGetonbrdUrl() when the URL is valid HTTPS but its hostname is not TRUSTED_HOST ('www.getonbrd.com'). It is the host-allowlist half of the SSRF guard; with redirect:'error' it pins every Get on Board request to www.getonbrd.com. A live throw means FEED_BASE's hostname drifted off the trusted host.
Source
Thrown at providers/getonbrd.mjs:31
// Wire in via a `job_boards:` entry with `provider: getonbrd`.
const FEED_BASE = 'https://www.getonbrd.com/api/v0/categories/programming/jobs';
const TRUSTED_HOST = 'www.getonbrd.com';
const PER_PAGE = 100;
const DEFAULT_MAX_PAGES = 3;
const MAX_PAGES_CAP = 50;
/** @param {string} url */
function assertGetonbrdUrl(url) {
let parsed;
try {
parsed = new URL(url);
} catch {
throw new Error(`getonbrd: invalid URL: ${url}`);
}
if (parsed.protocol !== 'https:') throw new Error(`getonbrd: URL must use HTTPS: ${url}`);
if (parsed.hostname !== TRUSTED_HOST) {
throw new Error(`getonbrd: untrusted hostname "${parsed.hostname}" — must be ${TRUSTED_HOST}`);
}
return url;
}
/** Resolve the page cap: a positive integer `max_pages` on the entry, capped. */
function resolveMaxPages(entry) {
const v = entry?.max_pages;
if (Number.isInteger(v) && v > 0) return Math.min(v, MAX_PAGES_CAP);
return DEFAULT_MAX_PAGES;
}
/**
* Normalize a single Get on Board job (JSON:API resource). Exported for tests.
*
* Field mapping → the normalized Job shape:
* - title: `attributes.title`, trimmed (items without one are dropped).
* - url: `links.public_url` — an absolute `https:` posting URL host-locked
* to www.getonbrd.com (off-host or non-https drops the item). It isView on GitHub (pinned to 9b17a8ac97)
Solutions
- Restore FEED_BASE to https://www.getonbrd.com/api/v0/categories/programming/jobs.
- If a different host is genuinely required, update TRUSTED_HOST to match in the same change and record the reason.
- Keep tests that hit this branch asserting the throw rather than changing the input.
Example fix
// before const FEED_BASE = 'https://getonbrd-cdn.example.com/api/v0/categories/programming/jobs'; const TRUSTED_HOST = 'www.getonbrd.com'; // mismatch // after const FEED_BASE = 'https://www.getonbrd.com/api/v0/categories/programming/jobs'; const TRUSTED_HOST = 'www.getonbrd.com';
Defensive patterns
Strategy: validation
Validate before calling
// Startup invariant: the Get on Board feed host must equal TRUSTED_HOST.
function checkGetonbrdHost() {
const u = new URL('https://www.getonbrd.com/api/v0/categories/programming/jobs');
if (u.hostname !== 'www.getonbrd.com') throw new Error('getonbrd host drift');
} Prevention
- Change FEED_BASE and TRUSTED_HOST together; never one without the other.
- Add a unit test: assert(new URL(FEED_BASE).hostname === TRUSTED_HOST).
- Treat an unexpected throw here as a possible constant override and audit the source.
When it happens
Trigger: FEED_BASE was pointed at a mirror/CNAME (e.g. 'https://getonbrd-mirror.example.com/...') without updating TRUSTED_HOST; a test calls assertGetonbrdUrl('https://evil.com/...'); the constant and the trusted host were edited out of sync.
Common situations: Contributor adds a regional mirror but edits only one symbol; a security test throws foreign hosts at the guard; an env override redirected the provider.
Related errors
- flowxtra: untrusted hostname "${parsed.hostname}" — must be
- gem: untrusted hostname "${parsed.hostname}" — must be one o
- getonbrd: invalid URL: ${url}
- getonbrd: URL must use HTTPS: ${url}
- glints: untrusted hostname "${parsed.hostname}" — must be on
AI-assisted analysis of santifer/career-ops@9b17a8ac97 (2026-08-13).
Data as JSON: /api/errors/a9cb2ce6401ae6de.
Report an issue: GitHub.