Issue Bug Closed

#97930Harden distribution overview in extension manager

Frank Nägler 07/13/22, 19:54 updated 10/15/24, 09:30

Description

The distribution overview page is vulnerable for XSS.

If a distribution description contains XSS within the first 150 characters, the overview execute the code.

File: EXT:extensionmanager/Resources/Private/Partials/List/Distribution.html

Affected code: {distribution.description -> f:format.crop(maxCharacters: 150) -> f:format.raw()}

Reproduce: inject the code <script>alert('XSS');</script> to the description of an extension / distribution and open the overview.

Reviews 2

Files 1

History 1821

  1. Oliver Hader changed Field 12 Frank Nägler 07/13/22, 19:56

  2. Oliver Hader changed Field 17 9.0, 10, 11 07/13/22, 19:58

  3. Oliver Hader changed Related to #82000 07/13/22, 19:59

  4. Oliver Hader changed TYPO3 Version 12 9 07/13/22, 19:59

  5. Oliver Hader commented 07/25/22, 10:57

    Did not manage yet to test it with extensions.typo3.dev (it does not accept files).
    In case description and other meta-data is passed as is via TER upload → extensions.xml → local XML import, this is a severe XSS vulnerability effecting all TYPO3 sites.

    https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N/E:H/RL:O/RC:C&version=3.1 (7.8, high)

  6. Frank Nägler commented 07/25/22, 11:00

    I tested it by changing the data directly in the database. I guess, that there is no filter in the upload process.

  7. Oliver Hader commented and changed attached exteions.xml.gz.png 07/25/22, 11:11

    extenions.xml.gz contents are imported as is into the database → XSS confirmed for that part of the vector.
    The missing piece is still how the TER handles/sanitizes uploaded data.

    exteions.xml.gz.png

  8. Oliver Hader changed priority Should have Must have 07/25/22, 11:12

  9. Oliver Hader changed target version 07/25/22, 11:13

  10. Oliver Hader commented 09/05/22, 17:30

    Did not manage to exploit this via upload:

        <version version="9.9.0">
          <title>The Official TYPO3 Cross-Site Scripting Package</title>
          <description>This package provides XSS by using scriptalert(12345)/script</description>
          <state>stable</state>
          <reviewstate>0</reviewstate>
          <category>distribution</category>
        ...
        <version version="9.9.1">
          <title>The Official TYPO3 Cross-Site Scripting Package</title>
          <description>&amp;lt;script&amp;gt;alert(2)&amp;lt;/script&amp;gt; ![CDATA[scriptalert(12345)/script &amp;lt;script&amp;gt;alert(3)&amp;lt;/script&amp;gt;]]</description>
          <state>stable</state>
          <reviewstate>0</reviewstate>
          <category>distribution</category>
  11. Oliver Hader commented and changed status Accepted Needs Feedback priority Must have Should have 09/05/22, 17:33

    After analyzing the behavior of the actual TER, I don’t see a real attack vector anymore. I’d opt for fixing this in public, what do you think?

  12. Frank Nägler commented 09/05/22, 17:37

    I am OK with fixing it in public.

    The sanitizer looks a bit weird, I think there are better ways to handle XML or data in XML, but your test proves that no vector exists, so let’s fix it public.

  13. Torben Hansen commented 09/06/22, 05:34

    Since the issue can not be exploited using the TER extension upload, a fix in public is also OK for me.

  14. Oliver Hader changed target version 09/06/22, 06:21

  15. Oliver Hader commented and changed project id subject XSS in distribution overview Harden distribution overview in extension manager category target version Field 12 Frank Nägler Field 17 9.0, 10, 11 09/14/22, 06:19

    → moved from security tracker to public core tracker

  16. Gerrit Code Review pushed patch set 1 for main to change 85260 status Needs Feedback Under Review 07/15/24, 13:32

  17. Gerrit Code Review pushed patch set 1 for 12.4 to change 85203 07/16/24, 11:25

  18. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % 07/16/24, 11:30

    Applied in changeset commit:b639beaea72e28ae30f0133ba035077e4dbbdbd0.

  19. Gerrit Code Review pushed patch set 2 for 12.4 to change 85203 status Resolved Under Review 07/19/24, 06:19

  20. Georg Ringer commented and changed status Under Review Resolved 07/19/24, 06:35

    Applied in changeset commit:d325006b19c1c3b16768180b7289f50ea4643567.

  21. Benni Mack changed status Resolved Closed 10/15/24, 09:30