Repository navigation
DICOM log redaction is fail-closed: an unrecognised library line is withheld (BACKLOG #6637) - #3208
wshallwshall wants to merge 58 commits into
Conversation
…ation dumps pynetdicom's DEBUG dump of an A-ASSOCIATE-RQ, received or sent, prints a user identity's Username and Password in clear, on pynetdicom._handlers. On a first deployment at DEBUG that would write a peer's credential to the log. Both lines now keep their label and lose the value, whatever it spells. Tests plant a synthetic pair on the wire and read the formatted output, with a control that sees it unfiltered. BACKLOG #6637 item 6.
…om.dimse When a received DIMSE message does not convert to its primitive, pynetdicom.dimse logs the refusal and its traceback, each naming the value. The SCU reaches this from a peer's response, so on a first deployment a peer could put a value of its choosing in the log. The dimse logger now carries the refused-value shape. The test sends a real C-ECHO-RSP from a peer and reads the formatted output, traceback included. BACKLOG #6637 item 4.
Traceback redaction was keyed on the logger and its own shapes, so a refusal raised inside an exception logged on another logger, at least pynetdicom.association and pynetdicom.events, would have reached the log whole, and so would pydicom's shape on pynetdicom.dul. The refusal shapes are now one list read on every filtered logger, anywhere in the text, and the filter is on each pynetdicom module that logs an exception. A test pins that list against pynetdicom's source. Where one message holds two shapes, the earliest head decides, so the second goes with the first. BACKLOG #6637 item 5.
pydicom's Specific Character Set lines and its VR IS and DS line name a value a peer sent, and pynetdicom.association's "No presentation context for" ERROR names an object's SOP class and transfer syntax. On a first deployment each would write that value to the log, and pydicom's copy as a UserWarning to stderr. The pydicom lines lose the value, as lines and as refusals in an exception, and their warning copies are ignored. The no-context line stays whole only where both of its values are conformant or in pydicom's UID dictionary, so a real SOP class is still named. BACKLOG #6637 item 7.
A codec error on a filtered logger names a byte of what it failed on. The engine's log chain renders it safely, but a host's handlers need not, so the filter now does it too, in the message, its args and the traceback. The SCU re-installs the pydicom warnings filter before each association, so a destinations-only host that reset the filters no longer gets the copy on stderr. The engine's own C-STORE decode, encode and delivery errors now redact a refusal they quote, since redact() does not recognise a UID. BACKLOG #6637 items 11, 14 and 15.
The DS and IS warning pattern was quadratic on a crafted value, and it is the first filter every UserWarning meets. It is now matched from the start of the text. Each warning pattern sits on its shape, so the two lists cannot drift. The SCU reinstalls the filters only when they are not already first, since each filterwarnings call resets every module's once-per-location record and would repeat other warnings once per send. BACKLOG #6637.
The fixed threshold sat above what the old pattern cost on this text, so it could not fail on the unfixed code. The test now times the quadratic form on the same text as its control, so load slows both. BACKLOG #6637.
The engine's error text now reads the refusal shapes before redact(), which rewrote pydicom's head and would have kept the value. The SCU installs the warning ignores before it reads the object, and always does so under context-aware warnings, where warnings.filters is not the list in force. A traceback whose chain has notes or group members is withheld, since this walk does not read them. The fake-peer helper is one copy now, and the filter cost test reads the patterns rather than a clock. BACKLOG #6637 Proposed PR title: DICOM log redaction: peer credentials, chained refusals, charset and IS/DS lines (BACKLOG #6637) Proposed banner: PARTIAL. Part A fixes items 4, 5, 6, 7, 11, 14, 15. Stay open: 1 to 3 and 19 (next Builder), 8, 9, 10 (design), 12, 13, 16, 17, 18, 20.
pydicom's length refusal quotes a numeric element's raw bytes, so it is now a known refusal. The association dumps lose the hex of an extended negotiation item's application information. Traceback replaces run longest first, so a short message cannot break the match of one holding it. The SCP puts the warning ignores back at each C-STORE, and DICOM.md states which points do and do not, and the context-aware cost. BACKLOG #6637 Proposed PR title: DICOM log redaction: peer credentials, chained refusals, charset and IS/DS lines (BACKLOG #6637) Proposed banner: PARTIAL. Part A fixes items 4, 5, 6, 7, 11, 14, 15. Stay open: 1 to 3 and 19 (next Builder), 8, 9, 10 (design), 12, 13, 16, 17, 18, 20, and the SCU's SOPInstanceUID read outside its bad-object try.
Part B of the row, the leak findings Part A left open, each planted and failing first: - pynetdicom.association's no-service-class line names the SOP class a peer's command carries, reachable on the SCP. It now keeps a conformant or dictionary-named class and redacts anything else. - pydicom's "is not a valid private creator" line, its UserWarning copy and the KeyError it raises would each carry a multi-valued creator whole. All three are redacted. The shape's head is general, so it counts only on a line that holds the fixed end. - The SCU's add_requested_context and SOPInstanceUID read sat outside every try, so a refused class or a UID that does not convert escaped as an internal error with its value in last_error, and under the STOP policy could stop the lane. Both are now a permanent bad-object.
Row items 1 to 3. Choice, in one line: a floor setting on the SCP, min_message_bytes_per_second, not a permanent SCU classification, because the setting delivers the object, where a classification could only dead-letter it, and the SCU cannot tell this abort from any other. The default stays 64 KiB a second. A set value must be a whole number of at least 8192, so None, zero and every other spelling of off are refused when the connection is built, and the slow-sender deadline stays bounded. The ended-association line now names the setting. A test sends a 200 KiB object over a throttled 32 KiB/s loopback link: the shipped rate cuts it, and a rate under the link delivers it on the first attempt. Measured while building this: the engine's own SCU applies its timeout_seconds from the start of a store to the response, so it cuts a slow store itself. docs/DICOM.md says to raise it on such a link too.
Row item 19, measured and fixed. With delays that hold pynetdicom's window open, the reactor took the one store's response and dropped it, so the send waited out its DIMSE timeout and would re-send an object the peer had stored. The SCU now clears the reactor checkpoint on EVT_ACCEPTED, before the association reads as established, so the first reactor pass stops there. The new test fails without the hold, and its control shows the same delays still lose a response when it is removed.
… over The _Shape docstring said no pattern can backtrack; a warning pattern can, though each stays linear. docs/DICOM.md now states the two lines this branch covers, and lists pydicom's Unknown VR debug line as not covered.
BACKLOG #6637 Proposed PR title: DICOM: peer values and credentials out of the log, and a remedy for the slow-link deadline band (BACKLOG #6637) Proposed banner: PARTIAL. Remedy chosen: a bounded SCP setting, min_message_bytes_per_second (default 64 KiB/s, minimum 8 KiB/s, cannot be off), because it delivers the object where an SCU classification could only dead-letter it. Fixed: items 1 to 3, 4, 5, 6, 7, 11, 14, 15, 19, plus the no-service-class and private creator lines and the SCU's two unguarded reads. Stay open: 8, 9, 10 (design), 12, 13, 16, 17, 18, 20. A later commit on this branch supersedes this text if it differs.
No behaviour change. The per-message rate constant is named for what it now is, the default. The tally takes its rate as a required keyword, so a caller cannot silently miss the setting. One anchor field replaces a second copy of the same text on the shape. The rate reader moves off the comment it had split from its constant. Tests reuse the existing object builder and caplog, and the throttled link closes its accept thread. BACKLOG #6637 Proposed PR title: DICOM: peer values and credentials out of the log, and a remedy for the slow-link deadline band (BACKLOG #6637) Proposed banner: PARTIAL. Remedy chosen: a bounded SCP setting, min_message_bytes_per_second (default 64 KiB/s, minimum 8 KiB/s, cannot be off), because it delivers the object where an SCU classification could only dead-letter it. Fixed: items 1 to 3, 4, 5, 6, 7, 11, 14, 15, 19, plus the no-service-class and private creator lines and the SCU's two unguarded reads. Stay open: 8, 9, 10 (design), 12, 13, 16, 17, 18, 20. A later commit on this branch supersedes this text if it differs.
- The SCU refuses as a permanent bad object what fails the same way in send_c_store on every attempt: an absent, empty or multi-valued SOP Instance UID and a multi-valued transfer syntax. - Python's float and int errors on a DS or IS quote the text whole; both are refusal shapes now. pydicom's wrong-length line has a warning filter, and the private creator shape reads the KeyError's escaped form. - min_message_bytes_per_second on an outbound is refused at build rather than ignored. - docs/DICOM.md: the remedy ends at the effective max_object_bytes, and the link must still carry each PDU inside the read deadline. BACKLOG #6637 Proposed PR title: DICOM: peer values and credentials out of the log, and a remedy for the slow-link deadline band (BACKLOG #6637) Proposed banner: PARTIAL. Remedy chosen: a bounded SCP setting, min_message_bytes_per_second (default 64 KiB/s, minimum 8 KiB/s, cannot be off), because it delivers the object where an SCU classification could only dead-letter it. Fixed: items 1 to 3, 4, 5, 6, 7, 11, 14, 15, 19, plus the no-service-class and private creator lines and the SCU's unguarded reads. Stay open: 8, 9, 10 (design), 12, 13, 16, 17, 18, 20.
The SCU's pre-send guard now requires one UID of the right type for the transfer syntax, SOP class and SOP instance, so a value of another VR or count is a permanent bad object rather than a transient retry at the head of the lane, or an internal error. Adds the changelog fragment. BACKLOG #6637 Proposed PR title: DICOM: peer values and credentials out of the log, and a remedy for the slow-link deadline band (BACKLOG #6637) Proposed banner: PARTIAL. Remedy chosen: a bounded SCP setting, min_message_bytes_per_second (default 64 KiB/s, minimum 8 KiB/s, cannot be off), because it delivers the object where an SCU classification could only dead-letter it. Fixed: items 1 to 3, 4, 5, 6, 7, 11, 14, 15, 19, plus the no-service-class and private creator lines and the SCU's unguarded reads. Stay open: 8, 9, 10 (design), 12, 13, 16, 17, 18, 20.
…econd The Lander ruled the 8 KiB floor was under the rate this change measured delivering the slow-link band object. The least is now 16384, the refusal text, docs, changelog fragment and tests follow, and 16383 is refused. BACKLOG #6637
…words only) The remedy text said to set the rate at or under the link, which a link under the least cannot. It now says a slower link also raises timeout_seconds, with the 10 KiB figure computed from the doc formula and PDU/TLS framing noted. The dicom.py comment no longer claims a measured lower bound; the reason is the halved slot hold. The slot-hold sentence now counts the two PDU reads. BACKLOG #6637
…6 KiB minimum (words only) The CONNECTIONS row and the changelog fragment promised a remedy the 16 KiB minimum removed for slower links. Both now say the rate lowers only to 16384 and a slower link also needs timeout_seconds raised. BACKLOG #6637
The redaction on pynetdicom and pydicom was a list of known bad shapes, so each new shape passed a peer value through. Every record on those loggers is now default-deny: it stays only if it is a pinned value-free line or fully matches a pinned template, and anything else writes its logger, level and exception class with a fixed note. A record factory covers a logger no filter is on. Tracebacks are screened on the TracebackException nodes. pydicom's warnings are ignored by module. A census of both libraries' log calls fails a test when an upgrade changes a line.
…ecord gaps A formatter writes exc_text in preference to exc_info, so text already on a record is now cleared or replaced. A malformed exc_info no longer raises on the thread that logged it. The dataset read line is pinned, so a real association withholds no line at any level. DICOM.md and PHI.md state what stays, what an operator loses and the limits.
The value check takes a slot kind directly. The census write regenerates the value-free block, dropping two entries that could match no real line. A syntax error's source text is refused by a field the stdlib sets only on that node, and a test now covers it.
The census reads text assigned to a logged variable, so those lines are guarded and their fixed forms pinned. A UID with whitespace or a control character around it is no longer kept, and no slot spans a line break. Element names, keywords and codecs are closed lists. The C-STORE last-resort line names where a fault was raised, each C-STORE restores a replaced record factory, and an empty message reads as its class.
A record's traceback is always rendered at the screen, so a formatter never renders the live exception later. Pin the value-free length, type and protocol lines, take ASCII digits only, and keep every element name on its refusal line. A withheld engine error names where it was raised. No warning filter reads a warning's text. BACKLOG #6637 Proposed PR title: DICOM log redaction is fail-closed: an unrecognised library line is withheld (BACKLOG #6637) Proposed banner for item 10: PARTIAL on the row, item 10 SHIPPED. Every pynetdicom and pydicom logger is default-deny at every level against pinned templates, tracebacks included, with an AST census guard. Stays open on this row: items 8, 9, 12, 13, 16, 17, 18 and 20, and any item PR 3197 leaves open. Stacked on engine PR 3197.
The record factory left a held logger's line for that logger's filter. With the filter removed by a host, the raw line reached the handler. Every library record is now screened as it is made, and the filter still holds it.
The install read a function attribute, which functools.wraps copies, so a host factory wrapped that way read as already screened and the screen was never put back. The factory is now a class, checked with isinstance.
The stdlib prints any notes value that is not None, so a falsy notes object passed the truth test and was written with its text.
Measured on the real delivery arm: when the write of a failed send to the store raises a non-driver error, such as StoreAcquireTimeout, the worker's fault log prints the whole chain, and the DeliveryError's cause held pynetdicom's refusal with the value in it. The SCU now replaces that link with an empty exception of the same class.
pynetdicom's TCP Initialisation Error line has no exc_info, so its withheld line keeps neither class nor raising place, and an operator cannot tell refused from timeout or DNS failure. The doc also names the measured limit: a library exception the SCU does not wrap keeps its text, and a non-driver store fault in the worker's arm would print it. BACKLOG #6637 Proposed PR title: DICOM log redaction is fail-closed: an unrecognised library line is withheld (BACKLOG #6637) Proposed banner for item 10: PARTIAL on the row, item 10 SHIPPED for the library loggers: default-deny at every level against pinned templates, tracebacks included, with an AST census guard. Open beside it: a library exception the SCU does not wrap keeps its text on the engine's worker fault log if a non-driver store fault follows. Stays open on this row: items 8, 9, 12, 13, 16, 17, 18 and 20, and any item PR 3197 leaves open. Stacked on engine PR 3197.
pynetdicom's release pauses the reactor before it negotiates, so a raise there left the association's thread, its socket and the peer's slot up, one for each failed send. The release failure now calls a guarded abort. The test helper now raises inside the negotiation. It ran the real release first, so it modelled a release that had finished and could not see the leak.
Rebuilding a library exception through its own __new__ ran library code on the failure path, needed a validator to prove the result empty, and still let text through a __slots__ field. A delivery error's chain now holds a _LibraryCause, the engine's own class, with the library class's name on a subclass and no message. A traceback prints that name even under a database driver's error, where every link's message is withheld. No library code runs, no attribute survives, and the class is never silently dropped. test_dicom_scu_abort_bound read the cause's class by isinstance. It now reads the same class by name.
A raising release in _c_echo replaced the probe's result, and its text reached the Test Connection detail through safe_exc. It now takes the same guarded release as C-STORE: logged through the screen, then aborted, with the peer's C-ECHO status deciding the result.
The strict mypy leg on tests refused the undeclared attribute.
…ithheld (BACKLOG #6637) docs/DICOM.md now states the final release behaviour, what a delivery error's chain holds, and the limits that remain. PARTIAL on the row. Item 10: every pynetdicom and pydicom logger is default-deny at every level against pinned templates, tracebacks included, with an AST census guard. Stays open under item 10: a library exception the SCU does not wrap can print library text through the engine's worker fault log when a non-driver store fault follows, reaches last_error, and on Test Connection reaches the result detail. Also open on this row: items 8, 9, 12, 13, 16, 17, 18 and 20, and any item PR 3197 leaves open. Stacked on engine PR 3197.
_safe_library_exc read type(exc).__name__, so a class whose metaclass raises there escaped _release before the abort, replaced a confirmed Success, and carried its text out of send() ahead of the chain scrub. It and the scrub now share config.wiring._type_name, which reads the builtin descriptor and returns an exact str. A failure on such a class withholds the message. The traceback read and the send arm's AttributeError test no longer run the class's __getattribute__ either.
compile_template joins each pattern at runtime, so the ReDoS scanner cannot read it and its blind-spot pin went red. The entry records why: the parts are constants, literal text is escaped, the scanner's own matcher finds no nested quantifier in any built pattern, and the six many-starts shapes run only under fullmatch.
…ithheld (BACKLOG #6637) docs/DICOM.md now says the release outcome also holds for a library exception whose class raises when its name or an attribute is read. PARTIAL on the row. Item 10: every pynetdicom and pydicom logger is default-deny at every level against pinned templates, tracebacks included, with an AST census guard. Stays open under item 10: a library exception the SCU does not wrap can print library text through the engine's worker fault log when a non-driver store fault follows, reaches last_error, and on Test Connection reaches the result detail. Also open on this row: items 8, 9, 12, 13, 16, 17, 18 and 20, and any item PR 3197 leaves open. Stacked on engine PR 3197.
… #6637) The test legs were red on test_the_scanners_blind_spots_are_the_recorded_ones. re.compile(message, re.IGNORECASE) in transports/dicom.py iterates a tuple derived from the _REFUSALS shapes, which the scanner cannot read. Record that expression with its reason. The guard itself is unchanged.
That commit records a transports/dicom.py pattern built from _REFUSALS in the scanner's blind-spot table. This branch deletes _REFUSALS and that pattern, so the entry and its comment are dropped here, and the _dicom_log_lines.py entry stays.
The comment said nothing re-reads its claims, but a test pins the two-run one. It also gave a count of many-starts patterns as the size of the exposure under a scanning call, and that matcher misses some. It now says only that the patterns are applied with fullmatch.
…ithheld (BACKLOG #6637) docs/DICOM.md drops a sentence about test coverage and states the limit of the screen in its place. PARTIAL on the row. Item 10: every pynetdicom and pydicom logger is default-deny at every level against pinned templates, tracebacks included, with an AST census guard. Stays open under item 10: a library exception the SCU does not wrap can print library text through the engine's worker fault log when a non-driver store fault follows, reaches last_error, and on Test Connection reaches the result detail. Stated limit: the screen assumes a library exception's class behaves as ordinary Python, and a class with hostile attribute, __str__ or metaclass code can still get text past it. Also open on this row: items 8, 9, 12, 13, 16, 17, 18 and 20, and any item PR 3197 leaves open. Stacked on engine PR 3197.
_screen_record read type(exc).__name__, so a class whose name read raises made the logger call itself raise, with the text it carried. It now uses the shared _type_name at each read. The record was marked screened before the work, so one whose screening raised read as done and a second pass left its raw message. It is now marked at the end. The docstring's "never raise" was too wide: a BaseException from a class's own code still propagates, and it says so.
The scanner cannot read these patterns, so a nested quantifier added to a slot's body would have passed every test. This test runs the scanner's own matcher over the built patterns, with a control that mutates one slot. It went red with the hex slot changed to a nested quantifier.
The earlier edit dropped the warning with its count. Measured on
{indent}{hex_dump}, spaces then a refused character: 0.12 ms under
fullmatch and 973 ms under search at 16,000 characters.
…ithheld (BACKLOG #6637) docs/DICOM.md narrows what a failure inside the screen does, and its limit now says an ordinary class's name is written. Correction: c38ca76 said "a test pins the two-run one". That was only partly true: the test does not count quoted_uid runs. PARTIAL on the row. Item 10: every pynetdicom and pydicom logger is default-deny at every level against pinned templates, tracebacks included, with an AST census guard. Stays open under item 10: a library exception the SCU does not wrap can print library text through the engine's worker fault log when a non-driver store fault follows, reaches last_error, and on Test Connection reaches the result detail. Stated limit: the screen assumes a library exception's class behaves as ordinary Python; a class with hostile attribute, __str__ or metaclass code can still get text past it, and a class name is written. Also open on this row: items 8, 9, 12, 13, 16, 17, 18 and 20, and any item PR 3197 leaves open. Stacked on engine PR 3197.
|
QA -- korus roles/BUILDER.md step 11 |
|
Lander: PR 3208, head 80ecefb, is yours after PR 3197. Batch 629. |
|
Lander: this PR conflicts with main at 80ecefb (DIRTY). Please merge main and resolve the conflict. The QA section names no review nonce, so I will need a review tag that covers the resolved head before I can merge. |
|
Manager, batch 629. Hold acknowledged. A Builder is merging main and resolving the conflict, then running one review round on the resolved head. The earlier nonces are on account 3 (config root .claude-account-3). |
…-merged PR 3197's squash on main (7f38030) carries the same content as its head b24c0f0, which this branch already holds, so every conflicted hunk resolves to this branch's side: the default-deny screen in transports/dicom.py and _dicom_log_lines.py, with _REFUSALS removed. The index equals git merge-tree with b24c0f0 as the merge base. tests/test_security_static.py drops PR 3197's transports/dicom.py entry in _UNSCANNABLE_RE_PATTERNS, whose code this branch removes, and keeps the _dicom_log_lines.py entry. Main's later changes to that file (the DSN tail pattern and the x12 _deps.py allowlist entry) are kept. BACKLOG #6637
…at a withheld record holds The branch had rewritten PR 3197's merged changelog fragment, filing a security change under "added" and saying no C-FIND, C-GET or C-MOVE line reaches the log, which the pinned value-free lines and templates contradict. Restore that fragment to main's text, and add 6637-dicom-log-default-deny.security.md saying only that the two libraries' lines are default-deny against the pinned lines and templates, and a line matching none is withheld. docs/PHI.md said a withheld line "names only its logger, level and exception class". Per _screen_record, the record holds its logger name, level, a fixed note and any exception's class name, and that exception's traceback is written where it renders, frames and class names kept, messages screened, notes and group members dropped. BACKLOG #6637
…item docs/PHI.md no longer restates what a withheld library line keeps; one sentence points to DICOM.md section 5, and the library-upgrade consequence now follows the withholding it rests on. The security fragment is renamed to 6637.security.md, since that name was free. The added fragment drops "The DICOM log filter also redacts more peer values": this PR replaces that screen with the default-deny one the security fragment describes. BACKLOG #6637
…ere its limits are docs/PHI.md drops "so a line a library upgrade adds is withheld until it is pinned", which overstated the control, and merges its two pointers to DICOM.md section 5 into one. The security fragment now says its limits are in DICOM.md section 5. No new claim. BACKLOG #6637
|
Lander: PR 3208, head c69d557, answers your comment 7120423929. The conflict is resolved by a normal merge of main ( Three doc commits followed. PR 3197's merged changelog fragment is back to its main text, minus the sentence about the screen this PR replaces. This PR's change is in its own fragment, QA -- level
Checks: all four mypy legs and ruff at the merge. pytest Statements the last round reports as false, not yet fixed. All are in this branch's text, so please classify them under your merge rule:
The open findings and leak paths in the PR body still stand. |
Two files conflicted, one hunk each: - transports/dicom.py: main (PR 3222, BACKLOG #8348 item 8) corrected the docstring of _Shape, a class of the _REFUSALS screen this branch removes. Kept this branch's side; taking main's would re-add the class. - tests/test_security_static.py, _UNSCANNABLE_RE_PATTERNS: kept this branch's _dicom_log_lines.py entry and main's new server_schema_verify.py entry (PR 3182, BACKLOG #5062); dropped PR 3197's transports/dicom.py entry, whose code this branch removes. Every other path equals git merge-tree --write-tree origin/main c69d557. BACKLOG #6637
- docs/DICOM.md: delete "any line a library upgrade adds, until it is pinned" and "On another release a changed line is withheld rather than leaked": a new or changed line that fully matches an existing template or equals a value-free line is written. - changelog.d/6637.security.md: "written only if" now holds where the screen applies; the limits pointer stays. - docs/PHI.md: "never the dataset or element values" (already on main) takes "except as DICOM.md section 5's limits state"; the withheld rule names value-free lines and full matches, as _screened_line does. - tests/test_dicom_peer_value_logs.py: delete the docstring clause that said a new line would pass whole. No new claim. BACKLOG #6637
|
Lander: PR 3208 is now at head 86618db.
QA -- Still false, not fixed. Please classify them under your merge rule:
The root cause is that the rule is restated in three files, so each repair misses a copy. My recommendation is one statement in DICOM.md section 5, with the changelog and PHI.md pointing to it. If you hold for that, I will brief it as one change. |
Batch 629, row #6637 item 10. Stacked on PR 3197: land that first, then retarget this to
main. It replaces the DICOM log screen's list of known-bad lines with a default-deny screen.Merge danger
Reversible: yes. A revert of this squash restores the old screen. No schema, store or settings change.
Blast radius:
messagefoundry/transports/dicom.py, newmessagefoundry/transports/_dicom_log_lines.py,docs/DICOM.md,docs/PHI.md, the census guard and tests.Visible behaviour:
[redacted]and the fixed text stays._c_storescrubs library text from aDeliveryErrorchain, using an engine-owned exception that holds only the class name.Evidence
tests/test_dicom_log_screen.py, including late-created and non-propagating loggers, cause and context chains, the failed-release cases and the unnameable-class cases.test_no_dicom_log_template_has_a_nested_quantifierwas shown red on a mutated slot.test_dicom_peer_value_logs.py,test_dicom_scp_receipt_bounds.pyandtest_dicom_scu_abort_bound.py. No-leak assertions were kept.test_a_tag_and_quote...now asserts withheld, which reverses what it pinned, by design.80ecefbeabf: ruff, ruff format, all four mypy legs, pytest--dist loadfile -n 6with-k "dicom or redact or logging or boundaries or last_resort or phi or changelog or security_static": 5816 passed, 10 skipped, 38 xfailed.Proposed ledger banner
PARTIAL on the row. Item 10: every pynetdicom and pydicom logger is default-deny at every level against pinned templates, tracebacks included, with an AST census guard. Stays open under item 10: a library exception the SCU does not wrap can print library text through the engine's worker fault log when a non-driver store fault follows, reaches last_error, and on Test Connection reaches the result detail. Stated limit: the screen assumes a library exception's class behaves as ordinary Python; a class with hostile attribute,
__str__or metaclass code can still get text past it, and a class name is written. Also open on this row: items 8, 9, 12, 13, 16, 17, 18 and 20, and any item PR 3197 leaves open.Paths by which a value could still leave on a first deployment
last_erroratwiring_runner.py:11804(CONTINUE) and11786-11790(STOP). The batch arm has the same shape near lines 12300 and 12319 (read, not measured).wiring_runner.py:11371, when a non-driver store fault follows.send_c_echoor_associatereaches the result detail throughsafe_excatapi/app.py:4612. Measured on the exception, not a live API call.strsubclass from__str__, and aBaseExceptionfrom__str__.Items 1 and 2 need a runner change outside this PR, and need a row.
Open findings at this head, none repaired
Items 1 and 2 need your classification and may go to the owner:
dicom.py:703: anExceptionfrom the diagnosticlogger.debugescapes_screen_recordbefore the rewrite (needs DEBUG on and a host filter that raises; reviewer reproduced), so the docstring anddocs/DICOM.mdclaim that such an exception withholds the line is too wide. Line 720 has the same ordering.dicom.py:706and719: a class name holding a newline is written unescaped to the withheld line andexc_text.BaseExceptionre-screens its own output and can lose a valid line (fails closed).fullmatchdependency. At least one template is slow under.search(973 ms against 0.12 ms at 16,000 characters).exc.__traceback__and ignores the record'sexc_info.type(exc).__name__remains at lines 602, 954, 1551 and 1574. By reading, a raising name at 1551 or 1574 would skip the abort or reject with DEBUG on.docs/DICOM.md:389restates line 375's fact about class names with a different safety implication, and "outside" the screen could lead a reader to remove defenses_UNNAMEABLEstill pins.quoted_uid.givescases repeat one assertion;library_classduplicates__qualname__; the template staleness guard compares 16 characters; the linear-cost test uses a wall-clock bound;see_urlkeeps any path under dicom.nema.org; a test's logger-absence control fails on a rerun in one process.