Skip to content

Add ServerName and DisableServerHeader configuration directives - #621

Open
ngillen wants to merge 1 commit into
tinyproxy:masterfrom
ngillen:feat/add-servername-configuration
Open

ngillen wants to merge 1 commit into
tinyproxy:masterfrom
ngillen:feat/add-servername-configuration

Conversation

@ngillen

@ngillen ngillen commented Jul 10, 2026

Copy link
Copy Markdown

The Server: HTTP response header was hardcoded to tinyproxy in error responses, disclosing the proxy software identity to clients:

  • Add ServerName directive to set a custom value for the Server header
  • Add DisableServerHeader directive to suppress the header entirely

Comment thread src/html-error.c Outdated
if (!k) return -1;
k = safestrdup (errornbuf);
if (!k)
return -1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no chance getting this merged with random whitespace changes all over the place. change so the result of git diff is identical to git diff -w

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, before pushing, I ran tinyproxy-indent.sh on the files I changed.

@ngillen
ngillen force-pushed the feat/add-servername-configuration branch 2 times, most recently from fa09b39 to 47ca873 Compare July 10, 2026 20:35
Allow operators to control the Server response header sent on error
pages. ServerName sets a custom value, DisableServerHeader suppresses
the header entirely, hiding the proxy software identity from clients.

Signed-off-by: Nicolas Gillen <[email protected]>
@ngillen
ngillen force-pushed the feat/add-servername-configuration branch from 47ca873 to 301ef8f Compare July 31, 2026 15:02
@rofl0r

rofl0r commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

this will also need src/conf-tokens.gperf adapted

essentially this is pretty similar to the ViaProxyName/DisableViaHeader pair, one could argue that someone setting those would also want the new directives you add to kick in. if someone sets DisableViaHeader to true, that indicates a pretty clear intention to not leak any identifying data.

@rofl0r

rofl0r commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

rather than adding new configuration knobs, i lean towards just not sending the server name in the error messages at all. we recently also removed all version number leaks, so this would not be unprecedented. thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants