Skip to content

Commit fca9bc0

Browse files
committed
fix: use unoptimized prop for HTTP images instead of open proxy
Reverts the http://** wildcard in remotePatterns which exposed the _next/image endpoint as an SSRF-capable outbound proxy. HTTP-only thumbnails on the graphics page now render with unoptimized prop, bypassing server-side fetch while still displaying correctly.
1 parent 969405a commit fca9bc0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

next.config.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ const nextConfig = {
163163
protocol: 'https',
164164
hostname: '**',
165165
},
166-
{
167-
protocol: 'http',
168-
hostname: '**',
169-
},
170166
],
171167
},
172168
compiler: {

src/pages/abs/[id]/graphics.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ const GraphicsPage: NextPage<{ statusCode?: number }> = ({ statusCode }) => {
9292
as={SimpleLink}
9393
href={figure.images[0].highres}
9494
>
95-
<NextImage src={figure.images[0].thumbnail} width="150" height="150" alt={figure.figure_label} />
95+
<NextImage
96+
src={figure.images[0].thumbnail}
97+
width="150"
98+
height="150"
99+
alt={figure.figure_label}
100+
unoptimized={figure.images[0].thumbnail.startsWith('http://')}
101+
/>
96102
<Box aria-hidden="true">{figure.figure_label}</Box>
97103
</Flex>
98104
);

0 commit comments

Comments
 (0)