Skip to content

Avoid splitting long authorized_keys lines - #456

Merged
mkj merged 2 commits into
mainfrom
pr/linelimit
Jul 5, 2026
Merged

Avoid splitting long authorized_keys lines#456
mkj merged 2 commits into
mainfrom
pr/linelimit

Conversation

@mkj

@mkj mkj commented Jul 5, 2026

Copy link
Copy Markdown
Owner

When reading text files, a long line would finish parsing then the
next iteration would continue with the tail of the line.
Instead the line should be skipped entirely.
Line lengths are now limited to 10000 characters, file parsing will
stop if that limit is hit.

Previously if external programs created authorized_keys entries from
untrusted sources, that could have allowed bypass of public key
restrictions or other confusion.

Also limit number of authorized_keys lines to 300

mkj added 2 commits July 5, 2026 22:16
When reading text files, a long line would finish parsing then the
next iteration would continue with the tail of the line.
Instead the line should be skipped entirely.
Line lengths are now limited to 10000 characters, file parsing will
stop if that limit is hit.

Previously if external programs created authorized_keys entries from
untrusted sources, that could have allowed bypass of public key
restrictions or other confusion.
Otherwise a too-large authorized_keys file could take a very long time
to iterate.
@mkj
mkj merged commit b3e6ab8 into main Jul 5, 2026
46 of 50 checks passed
@mkj
mkj deleted the pr/linelimit branch July 5, 2026 14:34
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.

1 participant