Open Bug 1957246 Opened 22 days ago Updated 20 days ago

Nested XSL can crash tab

Categories

(Core :: XSLT, defect)

Firefox 136
defect

Tracking

()

People

(Reporter: hanno, Unassigned)

Details

Attachments

(2 files)

685 bytes, application/octet-stream
Details
2.13 KB, application/gzip
Details
Attached file makexslnested

A deeply nested XSL stylesheet can crash a firefox tab.

I've attached a python script that creates xsl files including each other. 0.xsl includes 1.xsl, 1.xsl includes 2.xsl, etc.
This can crash a firefox tab with a stack overflow.

To reproduce:

  • Run makexslnested python script attached to this bug.
  • Place all the generated files in a dir on a web server (does not work locally due to same origin protection).
  • Point firefox to start.xml
  • Wait a few minutes (crash happens after around 30,000 nested files)

XSL nesting should probably have a depth limit. (FWIW: The xsltproc tool from libxslt stops after a depth of 40.)

Crash report from ASAN build (will attach full stack trace):
`[...]
#245 0x7f41618f419c in txStylesheetCompiler::loadURI(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::dom::ReferrerPolicy, txStylesheetCompiler*) /builds/worker/checkouts/gecko/dom/xslt/xslt/txStylesheetCompiler.cpp:370:33
#246 0x7f41618f419c in txStylesheetCompiler::loadURI(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::dom::ReferrerPolicy, txStylesheetCompiler*) /builds/worker/checkouts/gecko/dom/xslt/xslt/txStylesheetCompiler.cpp:370:33
#247 0x7f41618f419c in txStylesheetCompiler::loadURI(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::dom::ReferrerPolicy, txStylesheetCompiler*) /builds/worker/checkouts/gecko/dom/xslt/xslt/txStylesheetCompiler.cpp:370:33

SUMMARY: AddressSanitizer: stack-overflow /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc:99:10 in corrected_sendmsg
`

Attached file asan.21779.gz
Group: core-security → dom-core-security

Resource exhaustion crashes in content processes don't really need to be hidden.

Group: dom-core-security
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: