Bug 580391 - RCE on the default configuration of BIRT Viewer
Summary: RCE on the default configuration of BIRT Viewer
Status: CLOSED FIXED
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Vulnerability Reports (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Security vulnerabilitied reported against Eclipse projects CLA
QA Contact:
URL:
Whiteboard:
Keywords: security
Depends on:
Blocks:
 
Reported: 2022-07-18 09:03 EDT by Louis Wolfers CLA
Modified: 2023-03-15 10:44 EDT (History)
4 users (show)

See Also:


Attachments
Security advisory (218.39 KB, application/pdf)
2022-07-18 09:03 EDT, Louis Wolfers CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Wolfers CLA 2022-07-18 09:03:00 EDT
Created attachment 288634 [details]
Security advisory

Hi,

During the security assessment of one of our clients, we discovered security issues on BIRT Viewer. This issue could allow an authenticated attackers to execute commands on the underlying server.
Indeed, the default configuration of BIRT Viewer allows specifying report paths that match the current domain. However, in certain configurations, it does not check properly the origin of a Report Design file.

Find attached our advisory of the vulnerability.

Regards,
Comment 1 Louis Wolfers CLA 2022-07-18 10:57:55 EDT
By the way, clicking the provided link (at https://github.com/eclipse/birt/security/policy) does not mark the vulnerability as "commiters-only" and I cannot find the way to do it here.
Comment 2 Mikaël Barbero CLA 2022-07-29 10:04:28 EDT
@John, WDYT about this report?
Comment 3 Louis Wolfers CLA 2022-08-31 09:01:31 EDT
Hello,

Do you have any news regarding this report?

Best regards,
Comment 4 Louis Wolfers CLA 2022-10-31 05:53:43 EDT
Hello,

Do you have any news regarding this report?
Comment 5 Louis Wolfers CLA 2022-12-01 07:25:03 EST
Hello,

Just a gentle reminder about this report :)
Comment 6 Mikaël Barbero CLA 2022-12-01 07:27:53 EST
(In reply to Louis Wolfers from comment #5)
> Hello,
> 
> Just a gentle reminder about this report :)

@John, @Wim, please give a heads up to Louis. Thanks!
Comment 7 Wim Jongman CLA 2022-12-01 08:06:59 EST
(In reply to Louis Wolfers from comment #5)
> Hello,
> 
> Just a gentle reminder about this report :)

Hi Louis,

Thanks for providing this report. When reading the report, do I understand correctly that this is the solution?

The response to this request must be intercepted to either:
• Obtain a viewingSessionId, required to make the request to the SOAP endpoint that will effectively execute the
command.
• Modify the HTML base tag (which is reflected from the edited Host header) so that the browser makes the
subsequent requests to the correct server.
Comment 8 Louis Wolfers CLA 2022-12-01 09:39:35 EST
Hello Wim,

No, that's a step the attacker needs to do in order to successfully exploit the vulnerability.

The vulnerability relies on the fact that Birt uses the Host header to verify if the __report parameter is pointing to the current domain. However, an attacker can modify the Host header and the request would still be processed on poorly configured Apache servers (e.g. when no virtual hosts are defined).

My recommendation would be to:
 - Set "none" as the default value for the URL_REPORT_PATH_POLICY parameter.
 - Create a new URL_REPORT_DOMAIN_POLICY parameter that contains the list of authorized domains from which reports can be retrieved if the URL_REPORT_PATH_POLICY's value is "domain".

This is my opinion, but I would also remove the "all" value for the URL_REPORT_PATH_POLICY or at the very least indicate on the documentation that this parameter is really unsafe by default (I've seen this value being set without any firewalling). It should also be made very clear to the users that using remote paths for reports from untrusted sources is dangerous and can lead to remote code execution.
Comment 9 Louis Wolfers CLA 2023-01-03 04:58:44 EST
Hello and happy new year!

Wim, could you get a better look at the advisory? Feel free to ask questions if you have any.
Comment 10 Wim Jongman CLA 2023-01-03 08:40:23 EST
(In reply to Louis Wolfers from comment #8)

> 
> My recommendation would be to:
>  - Set "none" as the default value for the URL_REPORT_PATH_POLICY parameter.
>  - Create a new URL_REPORT_DOMAIN_POLICY parameter that contains the list of
> authorized domains from which reports can be retrieved if the
> URL_REPORT_PATH_POLICY's value is "domain".


Hi Louis,

Thank you for your persistence. I agree with your analysis. 

So the problem is that getting the hostname from the request is a vulnerability because that can be spoofed in the request. 

Is this BIRT's job to handle? How can we possibly code against all vulnerabilities in the server we are running on? Or code against ill-configured web servers?

Cheers, Wim
Comment 11 Wim Jongman CLA 2023-01-03 09:06:21 EST
(In reply to Louis Wolfers from comment #9)
> Hello and happy new year!
> 
> Wim, could you get a better look at the advisory? Feel free to ask questions
> if you have any.

I have made a change here. Can you take a look at it?  

https://github.com/eclipse/birt/pull/1165
Comment 12 Louis Wolfers CLA 2023-01-03 09:09:45 EST
(In reply to Wim Jongman from comment #10)

> Is this BIRT's job to handle? How can we possibly code against all
> vulnerabilities in the server we are running on? Or code against
> ill-configured web servers?

I do not think it should be BIRT's job to handle, to a certain extent: this vulnerability appears using the default configuration of Apache Tomcat and the default configuration of BIRT.

Another way of solving this issue is by only modifying the default configuration of BIRT (URL_REPORT_PATH_POLICY to none) and warning the user of potential security issues if their configuration allows arbitrary content on the Host header.

(In reply to Wim Jongman from comment #11)

> I have made a change here. Can you take a look at it?  
> 
> https://github.com/eclipse/birt/pull/1165

Sure, I will look at it
Comment 13 Louis Wolfers CLA 2023-01-03 09:25:56 EST
The patch looks good to me ! 

Could you assign a CVE for this vulnerability ?
Comment 14 Wim Jongman CLA 2023-01-04 05:36:02 EST
(In reply to Louis Wolfers from comment #13)
> The patch looks good to me ! 
> 
> Could you assign a CVE for this vulnerability ?

I would like to have the fix verified first.

Can you rerun your test with the version that contains the fix?

Binaries can be downloaded here:

https://github.com/eclipse/birt/actions/runs/3830002040
Comment 15 Louis Wolfers CLA 2023-01-04 08:34:51 EST
(In reply to Wim Jongman from comment #14)

> Can you rerun your test with the version that contains the fix?

Hello,

This fixes the vulnerability correctly, and I cannot find a way of bypassing it.

Do you know if you have any policies regarding vulnerability disclosures at Eclipse?
Comment 16 Wim Jongman CLA 2023-01-04 08:59:25 EST
Ok, I also verified it. @Wayne / @Mikael can one of you assign a CVE?

Louis, thanks for the discovery and for the proposed solution, which is described here:

https://github.com/eclipse/birt/discussions/1169
Comment 17 Mikaël Barbero CLA 2023-01-05 10:53:45 EST
(In reply to Wim Jongman from comment #16)
> Ok, I also verified it. @Wayne / @Mikael can one of you assign a CVE?
> 
> Louis, thanks for the discovery and for the proposed solution, which is
> described here:
> 
> https://github.com/eclipse/birt/discussions/1169

Please open a request at https://gitlab.eclipse.org/eclipsefdn/emo-team/emo/-/issues/new?issuable_template=cve. Thanks!
Comment 18 Louis Wolfers CLA 2023-01-05 11:54:49 EST
(In reply to Mikaël Barbero from comment #17)

> Please open a request at
> https://gitlab.eclipse.org/eclipsefdn/emo-team/emo/-/issues/
> new?issuable_template=cve. Thanks!

Hello Mikaël,

The request can be found at: https://gitlab.eclipse.org/eclipsefdn/emo-team/emo/-/issues/432

Thanks!
Comment 19 Mikaël Barbero CLA 2023-02-13 09:53:07 EST
@Wim,

Has this vul. been published in a release? Can the CVE be published?

Thanks!
Comment 20 Mikaël Barbero CLA 2023-02-13 09:54:42 EST
Wim, as you may not be able to see the ticket, the CVE number is CVE-2023-0100
Comment 21 Wim Jongman CLA 2023-02-13 10:59:51 EST
(In reply to Mikaël Barbero from comment #19)
> @Wim,
> 
> Has this vul. been published in a release? Can the CVE be published?
> 
> Thanks!

Yes, it can be published.
Comment 22 Mikaël Barbero CLA 2023-02-21 04:46:20 EST
If I'm not mistaken, 4.13 (the version containing the fix) has not been released yet. Correct? Are you sure you want to publish the CVE without having the release done first?
Comment 23 Wim Jongman CLA 2023-02-22 12:51:36 EST
(In reply to Mikaël Barbero from comment #22)
> If I'm not mistaken, 4.13 (the version containing the fix) has not been
> released yet. Correct? Are you sure you want to publish the CVE without
> having the release done first?

Yes, you are right. Let me release it first.
Comment 24 Louis Wolfers CLA 2023-02-27 06:46:23 EST
Hello Wim,

Just wondering, do you have an ETA for the 4.13 release?
Comment 25 Wim Jongman CLA 2023-02-27 09:43:47 EST
(In reply to Louis Wolfers from comment #24)
> Hello Wim,
> 
> Just wondering, do you have an ETA for the 4.13 release?

Yes, March 1, 2023 👍

https://projects.eclipse.org/projects/technology.birt
Comment 26 Louis Wolfers CLA 2023-03-09 09:35:08 EST
Hello,

Do you wish to wait a little bit before releasing?

Also, would you mind if I talk about this vulnerability at a small cyber-security conference (with a small public of around 40 people, mostly students)?

Best regards
Comment 27 Wim Jongman CLA 2023-03-09 11:23:40 EST
(In reply to Louis Wolfers from comment #26)
> Hello,
> 
> Do you wish to wait a little bit before releasing?
> 
> Also, would you mind if I talk about this vulnerability at a small
> cyber-security conference (with a small public of around 40 people, mostly
> students)?
> 
> Best regards

Hi Louis,

We have released 4.13. No problem with your talk. Thanks for helping us.
Comment 28 Mikaël Barbero CLA 2023-03-15 10:43:21 EDT
CVE has been published.

Closing and removing the committer-only visibility.
Comment 29 Mikaël Barbero CLA 2023-03-15 10:44:00 EDT
Thank you Louis for your report and your patience with this one!