jagrosh / jagrosh/MusicBot

[Bug Report] Title of videos is parsed for markdown

Open
#1,208 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.8k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

### Bug Description

The title of videos that are played are not sanitized when the bot sends the now playing message. This can be used to display markdown text.

Normally the text is bold but this can be removed by adding \*\* before and after the title.

Title is .\*\*I'm not bold\*\*.
![image](https://user-images.githubusercontent.com/52386671/188029012-6304e671-0f39-4362-88cf-19f275fae279.png)

Another example with an actual song
![image](https://user-images.githubusercontent.com/52386671/188030476-a036646e-f19e-48bc-a164-87e7ccdb1ed5.png)

This can be used with other markdown styles as well as spoiler tags

### Steps to Reproduce

1. Edit title to have markdown syntax
2. Play the video with the bot

### Expected Result

The characters are displayed and not parsed as markdown.

### Debug Output

```
System Properties:
java.version = 11.0.15
java.vm.name = OpenJDK 64-Bit Server VM
java.vm.specification.version = 11
java.runtime.name = OpenJDK Runtime Environment
java.runtime.version = 11.0.15+10-Ubuntu-0ubuntu0.20.04.1
java.specification.version = 11
os.arch = amd64
os.name = Linux

JMusicBot Information:
Version = 0.3.8
Owner = 282964607142723585
Prefix = a.
AltPrefix = null
MaxSeconds = 7200
NPImages = false
SongInStatus = false
StayInChannel = false
UseEval = false
UpdateAlerts = true

Dependency Information:
JDA Version = 4.4.0_352
JDA-Utilities Version = 3.0.5
Lavaplayer Version = 1.3.78

Runtime Information:
Total Memory = 38
Used Memory = 24

Discord Information:
ID = 985183321862574230
Guilds = 3
Users = 6
```

### Additional Info

_No response_

### Checklist

- [X] I have looked for information about this [within the documentation](https://jmusicbot.com/)
- [X] I have searched for similar issues [on the issues page](https://github.com/jagrosh/MusicBot/issues?q=is%3Aissue)
- [X] I am running the latest version of the bot: ![Release](https://img.shields.io/github/release/jagrosh/MusicBot.svg)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the code that builds and sends the bot's now-playing message, then follow how the video title enters that message. Reproduce the issue with a title containing Markdown syntax and verify that the displayed characters are no longer interpreted as formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.