Git Product home page Git Product logo

Comments (6)

azlux avatar azlux commented on June 12, 2024

@SYZYGY-DEV333 Yes, it's quite easy to implement.
In this case, the path will be into the config file, and you will need to play it with the command !playfile file_name for example. Is that good for you ?

from mumbleradioplayer.

azlux avatar azlux commented on June 12, 2024

Feature added !

from mumbleradioplayer.

LordYuuma avatar LordYuuma commented on June 12, 2024

The current implementation has a path traversal bug. Since the parameter goes through unchecked, one can chain "../" to discover potentially existing media files and play them. Potential leakage of non-media files is prevented by FFMPEG returning an error.

Below is a patch, that fixes the bug by rejecting any parameter with a slash in it. This is not ideal, especially since one would also not allow any subdirectories to be accessed, but since those tend to get long anyway, it's a good thing to not make the user remember folder structures just to play a file.

diff --git a/mumbleRadioPlayer.py b/mumbleRadioPlayer.py
index 56717e2..6c59cda 100644
--- a/mumbleRadioPlayer.py
+++ b/mumbleRadioPlayer.py
@@ -78,6 +78,9 @@ class MumbleRadioPlayer:
                 self.play_stream(parameter)
 
             if command == self.config.get('command', 'play_file') and parameter:
+                if "/" in parameter:
+                    self.mumble.users[text.actor].send_message(self.config.get('strings', 'bad_file'))
+                    return
                 path = self.config.get('bot', 'music_folder') + parameter
                 if os.path.isfile(path):
                     self.launch_play_file(path)

from mumbleradioplayer.

azlux avatar azlux commented on June 12, 2024

Good point !

from mumbleradioplayer.

azlux avatar azlux commented on June 12, 2024

fixed in 4fb9bc2 , thank @LordYuuma
(not tested, I will have time next week)

from mumbleradioplayer.

azlux avatar azlux commented on June 12, 2024

Command !list added in 84e3b83 to improve the local audio file feature.

from mumbleradioplayer.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.