Skip to content

Add SingleLineString to reject line breaks in RFD attribute values - #615

Merged
notpeter merged 2 commits into
mainfrom
single-line-string
Nov 12, 2026
Merged

notpeter merged 2 commits into
mainfrom
single-line-string

Conversation

@notpeter

Copy link
Copy Markdown
Collaborator

Add SingleLineString which is a string that does not contain \r or \n.
Use it for RfdAttrValue.value and update_{state,discussion,labels}
This prevents attribute updates from introducing additional lines of document header.
SDK type changes from String to RfdAttrValueValue, but does not impact callers.
When clients pick up the new SDK it can be validated client side too (e.g. with Zod).

@notpeter notpeter changed the title Reject line breaks in RFD attribute values with SingleLineString Add SingleLineString to reject line breaks in RFD attribute values Nov 12, 2026
@notpeter
notpeter requested a review from augustuswm November 12, 2026 14:08
@notpeter
notpeter added this pull request to stack #616 November 12, 2026 14:11
@notpeter

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread rfd-data/src/content/asciidoc.rs Resolved
@notpeter
notpeter merged commit 1619cdf into main Nov 12, 2026
12 checks passed
@notpeter
notpeter deleted the single-line-string branch November 12, 2026 17:39
notpeter added a commit that referenced this pull request Nov 12, 2026
- `POST /rfd/{number}/attr/{attr}`: Validate permissions before
inspecting user provided data
- Reject attributes containing newlines (`\r` or `\n`)
- Limit `{authors}` expansion size to prevent DoS from malicious input
- See also: #615

> 🤖 robot:
> An anonymous internet caller can crash the rfd-api process with one
request of up to 1 MiB, and can repeat it after every restart. The
request must target an RFD the caller can read, such as a public one,
whose stored document has no :authors: header line before the edited
attribute.

Claude Link (team-shared): 

https://claude.ai/code/cshk_01Q5Ej2cHBc7wgaksc9BPkaiPgvaeaJszgNYbzxzfE9Cj5
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