{"record":{"id":"0ed4d61a87d55a0d","repo":"santifer/career-ops","slug":"weworkremotely-url-must-use-https-url","errorCode":null,"errorMessage":"weworkremotely: URL must use HTTPS: ${url}","messagePattern":"weworkremotely: URL must use HTTPS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/weworkremotely.mjs","lineNumber":22,"sourceCode":"// We Work Remotely provider - board-wide RSS feed\n// (https://weworkremotely.com/remote-jobs.rss). The feed is public, no-auth,\n// and XML, so it is parsed in-process with the same tiny tag extractor approach\n// as providers/personio.mjs rather than adding an XML dependency.\n//\n// Wire in via a `job_boards:` entry with `provider: weworkremotely`.\n\nconst FEED_URL = 'https://weworkremotely.com/remote-jobs.rss';\nconst TRUSTED_HOST = 'weworkremotely.com';\n\n/** @param {string} url */\nfunction assertWwrUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`weworkremotely: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`weworkremotely: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`weworkremotely: untrusted hostname \"${parsed.hostname}\" - must be ${TRUSTED_HOST}`);\n  }\n  return url;\n}\n\n// NaN-safe Date.parse - `|| undefined` would also coerce a valid epoch 0.\nfunction toEpochMs(value) {\n  if (!value) return undefined;\n  const parsed = Date.parse(value);\n  return Number.isNaN(parsed) ? undefined : parsed;\n}\n\nfunction fallbackCompany(entry) {\n  return typeof entry?.name === 'string' && entry.name.trim() ? entry.name.trim() : 'We Work Remotely';\n}\n\n/** @type {Provider} */","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/providers/weworkremotely.mjs#L4-L40","documentation":"SSRF guard branch: the URL parsed but its protocol is not https:. Guarantees the feed is never fetched over plain HTTP, where it could be transparently intercepted. As with the other weworkremotely URL guards, this only fires against the FEED_URL constant.","triggerScenarios":"Reached with the FEED_URL constant; fires if a maintainer sets it to an http:// URL.","commonSituations":"Someone downgraded the constant to http during local debugging and forgot to revert; a bad merge.","solutions":["Set FEED_URL back to its https form.","Never bypass the protocol check — it is load-bearing for SSRF safety."],"exampleFix":"// before\nconst FEED_URL = 'http://weworkremotely.com/remote-jobs.rss';\n// after\nconst FEED_URL = 'https://weworkremotely.com/remote-jobs.rss';","handlingStrategy":"validation","validationCode":"const u = new URL(FEED_URL);\nif (u.protocol !== \"https:\") throw new Error(\"weworkremotely: FEED_URL must be https\");","typeGuard":"const isHttps = (s) => { try { return new URL(s).protocol === \"https:\"; } catch { return false; } };","tryCatchPattern":null,"preventionTips":["Treat the https requirement as load-bearing for SSRF safety — do not relax it.","Add a CI lint that flags http:// literals in providers/."],"tags":["validation","url","ssrf-guard","https","weworkremotely","invariant"],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}