FreeAndNil commented on PR #376:
URL: https://github.com/apache/logging-log4net/pull/376#issuecomment-7111908797

   Implementation plan for #376, kept here for the record. Written up to 
describe the change as it stands on the branch.
   
   <details>
   <summary>Plan</summary>
   
   # Fixes from the 2026-11 audit, part 6: syslog notes, XML layouts and Telnet
   
   ## Context
   
   The same scan as #355 reported, among the lows, four independent points: the 
syslog appenders send
   no record for an empty render, `XmlLayout` and `XmlLayoutSchemaLog4J` write 
a tab in an attribute
   literally on .NET Framework, `TelnetAppender` sends NUL raw, and 
`XmlLayoutSchemaLog4J` writes into
   the event's properties. The empty render is intentional and only documented. 
Three issues: #361
   (the tab, its line-break half fixed in #364), #374 (Telnet NUL), #375 (the 
event's properties).
   
   ## Constraints that shape the design
   
   - An empty render carries no text, so sending no record loses only the 
occurrence; not worth a
     behaviour change.
   - On net462 the layouts write through `XmlTextWriter`, which writes a tab in 
an attribute
     literally; attribute-value normalization reads it back as a space. 
netstandard already writes
     `&#x9;`.
   - `XmlTextWriter` stays on net462: it writes the `log4j:` prefix undeclared.
   - NUL is escaped as `\0` per sink, as Trace, Debug and LocalSyslog do.
   - The event is shared with every appender of the call; a layout that writes 
into its properties
     races a buffering appender's flush.
   
   ## Changes
   
   1. The empty render: `.oss-scanner/threat_model.md` names it as not a 
finding, AGENTS.md points
      there, one-line comments in both syslog appenders, both appender pages. 
No changelog.
   2. #361 On net462, `WriteAttributeStringSafe` writes each tab as `&#x9;`; a 
value without a tab
      takes the old call.
   3. #374 `TelnetAppender` escapes NUL before queueing the event. The stale 
comment on the encoder is
      corrected.
   4. #375 `XmlLayoutSchemaLog4J` translates its four keys on a copy of the 
properties and writes the
      copy. Visible change: later appenders of the same event no longer see the 
four keys.
   
   Docs: the syslog and Telnet appender pages, XML doc comments of the changed 
members. One changelog
   entry per visible change in `src/changelog/3.6.1`.
   
   ## Sequencing
   
   1. The documentation of the empty render.
   2. The tab on net462.
   3. The Telnet NUL.
   4. The properties copy.
   5. Each commit: test against the unfixed code first, fix, mutate each 
changed line, review loop.
   
   ## Verification
   
   - `dotnet build` of all targets with 0 warnings, tests on net10 and, on 
Windows, net462.
   - A split of an empty render or one with only line breaks gives no record.
   - A tab in a property name, a property value and the identity reads back 
exactly for both layouts,
     with leading, doubled and trailing tabs. On Linux the net462 branch was 
checked by forcing it with
     an `XmlTextWriter`: unfixed the tab is written literally.
   - A real Telnet client receives `adm\0in` with a visible `\0` and no raw NUL.
   - After formatting, a fixed and an unfixed event keep their properties; the 
four keys still reach
     the output; an existing key wins; an empty value is not translated.
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to