question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

{StaticResource} references are broken for XPS Paths after December2022 security patch

See original GitHub issue
  • Windows version: (22H2 19045.2364)
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

Problem description:

{StaticResource} references on Path elements are not loaded in FixedPage after recent security patch.

Actual behavior:

FixedPage fails to load Path elements that have static resource references. Path data is set to null so those elements are not rendered with RenderTargetBitmap for example.

Expected behavior:

Path references are loaded.

Minimal repro:

  • Make sure December 13, 2022, security updates for .NET Framework is installed
  • Load attached xps file: p1.zip
var filePath = "<path>";
var doc = new XpsDocument(filePath, FileAccess.Read);
var seq = doc.GetFixedDocumentSequence();

foreach (var docRef in seq.References)
{
	var fixedDoc = docRef.GetDocument(false);
	foreach (var page in fixedDoc.Pages)
	{
		var fixedPage = page.GetPageRoot(false);
		foreach (var element in fixedPage.Children)
		{
			Debug.Assert(((System.Windows.Shapes.Path)element).Data != null);
		}
	}
}

You can probably reproduce this by printing most PDF files with some text to Microsoft XPS Document Writer and then trying to present it in a WPF app (that is not Windows XPS Viewer).

Workaround:

Alternate Workaround from kb5022083 (allowing all XPS types) works. I haven’t figured out which type needs to be specifically allowed for this particular case. The script they have in the first part to allow certain types explicitly doesn’t work.

https://support.microsoft.com/en-au/topic/kb5022083-change-in-how-wpf-based-applications-render-xps-documents-a4ae4fa4-bc58-4c37-acdd-5eebc4e34556

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Reactions:4
  • Comments:22 (15 by maintainers)

github_iconTop GitHub Comments

4reactions
pchaurasia14commented, Feb 1, 2023

We’ve released an OOB package that should address the XPS compatibility issues. You may refer to this link for more information on installing the fix.

3reactions
singhashish-wpfcommented, May 12, 2023

There is an unexpected delay in this release. Will keep the thread posted for the updates.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Security Bulletin—December 2022
The Android Security Bulletin contains details of security vulnerabilities affecting Android devices. Security patch levels of 2022-12-05 or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found