Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

# Report dependency vulnerabilities without blocking until the baseline is remediated.
- name: Dependency audit
continue-on-error: true
run: pnpm audit --prod --audit-level=high

- name: Lint
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ All notable changes to this project will be documented in this file.
- Trim full text content from list and search responses.
- Parallelize home-suggestion reads and collapse short/long reading counts into a single query.
- Declare the generated search index column and indexes in the schema so schema sync cannot drop them.
- Add a production dependency audit step to CI.
- Refresh production dependencies and align Tailwind CSS core with the Vite plugin at version 4.3.3.
- Replace the unmaintained `private-ip` URL-validation dependency with `ipaddr.js` and expand SSRF protection coverage.
- Make the production dependency audit a blocking CI check after clearing high-severity vulnerabilities.

## [v0.2.0] - 2026-07-29

Expand Down
8 changes: 4 additions & 4 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test": "cross-env NODE_ENV=test vitest"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.1024.0",
"@aws-sdk/s3-request-presigner": "^3.1024.0",
"@aws-sdk/client-s3": "^3.1098.0",
"@aws-sdk/s3-request-presigner": "^3.1098.0",
"@hono/node-server": "^1.19.7",
"@hono/zod-openapi": "^1.1.5",
"@mozilla/readability": "^0.6.0",
Expand All @@ -27,20 +27,20 @@
"bullmq": "^5.73.0",
"csv-parse": "^6.2.1",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.44.7",
"drizzle-orm": "^0.45.2",
"drizzle-zod": "^0.8.3",
"hono": "catalog:",
"hono-pino": "^0.10.3",
"hono-rate-limiter": "^0.5.3",
"ioredis": "^5.10.1",
"ipaddr.js": "^2.4.0",
"linkedom": "^0.18.12",
"nanoid": "^5.1.7",
"pg": "^8.16.3",
"pg-transactional-tests": "^1.2.0",
"pino": "^10.1.0",
"pino-pretty": "^13.1.3",
"playwright-core": "1.53.2",
"private-ip": "^3.0.2",
"turndown": "^7.2.4",
"zod": "catalog:"
},
Expand Down
26 changes: 26 additions & 0 deletions apps/server/src/lib/url-validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@ describe('isValidUrl', () => {
expect(lookupMock).not.toHaveBeenCalled();
});

it.each([
['loopback', 'https://127.0.0.1/article'],
['CGNAT', 'https://100.64.0.1/article'],
['multicast', 'https://224.0.0.1/article'],
['link-local', 'https://169.254.10.10/article'],
['this-network', 'https://0.0.0.0/article']
])('rejects IPv4 SSRF literal (%s): %s', async (_label, url) => {
expect(await isValidUrl(url)).toBe(false);
expect(lookupMock).not.toHaveBeenCalled();
});

it.each([
['loopback', 'https://[::1]/article'],
['link-local', 'https://[fe80::1]/article'],
['unique-local', 'https://[fd12:3456:789a::1]/article'],
['multicast', 'https://[ff02::1]/article']
])('rejects IPv6 SSRF literal (%s): %s', async (_label, url) => {
expect(await isValidUrl(url)).toBe(false);
expect(lookupMock).not.toHaveBeenCalled();
});

it('accepts a public IPv4 literal', async () => {
expect(await isValidUrl('https://93.184.216.34/article')).toBe(true);
expect(lookupMock).not.toHaveBeenCalled();
});

it.each(['https://[::ffff:7f00:1]/feed.xml', 'https://[::ffff:a9fe:a9fe]/feed.xml'])(
'rejects hexadecimal IPv4-mapped IPv6 literals: %s',
async (url) => {
Expand Down
17 changes: 14 additions & 3 deletions apps/server/src/lib/url-validator.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import { lookup } from 'node:dns/promises';
import { isIP } from 'node:net';

import isPrivateIP from 'private-ip';
import ipaddr from 'ipaddr.js';

const DNS_LOOKUP_TIMEOUT_MS = 2000;

// Maintained-library backstop (replaces the unmaintained `private-ip`). Treats any address that
// is not a global unicast as blocked, matching the SSRF posture of the explicit range checks
// below and keeping defense-in-depth intact.
function isNonPublicAddress(address: string): boolean {
try {
return ipaddr.parse(address).range() !== 'unicast';
} catch {
return false;
}
}

function isBlockedIpv4Address(address: string): boolean {
const [firstOctet = Number.NaN, secondOctet = Number.NaN] = address
.split('.')
Expand Down Expand Up @@ -34,7 +45,7 @@ function isBlockedIpv4Address(address: string): boolean {
return true;
}

return Boolean(isPrivateIP(address));
return isNonPublicAddress(address);
}

function isBlockedIpv6Address(address: string): boolean {
Expand Down Expand Up @@ -64,7 +75,7 @@ function isBlockedIpv6Address(address: string): boolean {
return true;
}

return Boolean(isPrivateIP(address));
return isNonPublicAddress(address);
}

function isBlockedAddress(address: string): boolean {
Expand Down
16 changes: 8 additions & 8 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"@fontsource/opendyslexic": "^5.2.5",
"@fontsource/spectral": "^5.2.8",
"@phosphor-icons/react": "^2.1.10",
"@tailwindcss/vite": "^4.2.0",
"@tailwindcss/vite": "^4.3.3",
"@tanstack/react-query": "^5.95.0",
"@tanstack/react-query-devtools": "^5.95.0",
"@tanstack/react-router": "^1.168.0",
"@tanstack/react-router-devtools": "^1.166.0",
"@tanstack/react-router": "^1.170.18",
"@tanstack/react-router-devtools": "^1.167.0",
"@tanstack/react-virtual": "^3.14.5",
"@tanstack/router-plugin": "^1.167.0",
"@tanstack/zod-adapter": "^1.166.9",
"@tanstack/router-plugin": "^1.168.23",
"@tanstack/zod-adapter": "^1.167.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
Expand All @@ -52,10 +52,9 @@
"react-i18next": "^17.0.2",
"react-markdown": "^10.1.0",
"remark-gfm": "^4.0.1",
"shadcn": "^4.1.2",
"sonner": "^2.0.7",
"tailwind-merge": "^3.4.0",
"tailwindcss": "^4.1.17",
"tailwindcss": "^4.3.3",
"tailwindcss-animate": "^1.0.7",
"tw-animate-css": "^1.4.0",
"vaul": "^1.1.2",
Expand All @@ -75,8 +74,9 @@
"globals": "^16.5.0",
"jsdom": "^27.2.0",
"msw": "^2.12.14",
"shadcn": "^4.1.2",
"typescript": "^5.9.3",
"vite": "^8.0.0",
"vite": "^8.0.16",
"vitest": "catalog:"
}
}
Loading