@involvex/youtube-music-cli 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.23](https://github.com/involvex/youtube-music-cli/compare/v0.0.22...v0.0.23) (2026-02-20)
2
+
3
+ ## [0.0.22](https://github.com/involvex/youtube-music-cli/compare/v0.0.21...v0.0.22) (2026-02-20)
4
+
5
+ ### Features
6
+
7
+ - add Homebrew and Winget publish workflows with Snyk security rules ([cff659b](https://github.com/involvex/youtube-music-cli/commit/cff659b2775fd50bb898fbf9b552e0fa413ff0fa))
8
+
1
9
  ## [0.0.21](https://github.com/involvex/youtube-music-cli/compare/v0.0.20...v0.0.21) (2026-02-20)
2
10
 
3
11
  ## [0.0.20](https://github.com/involvex/youtube-music-cli/compare/v0.0.19...v0.0.20) (2026-02-20)
@@ -38,7 +38,7 @@ function buildLastfmSignature(params, secret) {
38
38
  .sort()
39
39
  .map(k => `${k}${params[k]}`)
40
40
  .join('');
41
- return createHash('md5')
41
+ return createHash('sha256')
42
42
  .update(sorted + secret)
43
43
  .digest('hex');
44
44
  }
@@ -7,6 +7,7 @@ declare class StaticFileService {
7
7
  * Get MIME type for a file extension
8
8
  */
9
9
  private getMimeType;
10
+ private resolveSafeFilePath;
10
11
  /**
11
12
  * Load index.html into memory
12
13
  */
@@ -1,7 +1,7 @@
1
1
  // Static file serving service for web UI
2
2
  import { readFile } from 'node:fs/promises';
3
3
  import { existsSync } from 'node:fs';
4
- import { extname, join, dirname } from 'node:path';
4
+ import { extname, join, dirname, normalize, resolve, sep } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { logger } from "../logger/logger.service.js";
7
7
  const MIME_TYPES = {
@@ -55,6 +55,23 @@ class StaticFileService {
55
55
  const ext = extname(filePath).toLowerCase();
56
56
  return MIME_TYPES[ext] || 'application/octet-stream';
57
57
  }
58
+ resolveSafeFilePath(urlPath) {
59
+ let decodedPath;
60
+ try {
61
+ decodedPath = decodeURIComponent(urlPath);
62
+ }
63
+ catch {
64
+ return null;
65
+ }
66
+ const relativePath = normalize(decodedPath).replace(/^[\\/]+/, '');
67
+ const rootPath = resolve(this.webDistDir);
68
+ const resolvedPath = resolve(rootPath, relativePath);
69
+ const rootPrefix = rootPath.endsWith(sep) ? rootPath : `${rootPath}${sep}`;
70
+ if (resolvedPath !== rootPath && !resolvedPath.startsWith(rootPrefix)) {
71
+ return null;
72
+ }
73
+ return resolvedPath;
74
+ }
58
75
  /**
59
76
  * Load index.html into memory
60
77
  */
@@ -111,7 +128,12 @@ class StaticFileService {
111
128
  return;
112
129
  }
113
130
  // Serve static files
114
- const filePath = join(this.webDistDir, urlPath);
131
+ const filePath = this.resolveSafeFilePath(urlPath);
132
+ if (!filePath) {
133
+ res.writeHead(400, { 'Content-Type': 'text/plain' });
134
+ res.end('Bad Request');
135
+ return;
136
+ }
115
137
  try {
116
138
  // Check if file exists
117
139
  if (!existsSync(filePath)) {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@involvex/youtube-music-cli",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "- A Commandline music player for youtube-music",
5
5
  "repository": {
6
6
  "type": "git",
package/readme.md CHANGED
@@ -93,6 +93,20 @@ npm install -g @involvex/youtube-music-cli
93
93
  bun install -g @involvex/youtube-music-cli
94
94
  ```
95
95
 
96
+ ### Homebrew
97
+
98
+ ```bash
99
+ brew install involvex/youtube-music-cli/youtube-music-cli
100
+ ```
101
+
102
+ ### Winget
103
+
104
+ ```bash
105
+ winget install Involvex.YoutubeMusicCLI
106
+ ```
107
+
108
+ > Maintainers: tag pushes trigger `.github/workflows/homebrew-publish.yml` and `.github/workflows/winget-publish.yml`. Homebrew uses the tap format `involvex/youtube-music-cli/youtube-music-cli`, so ensure the formula file exists on the default branch at `Formula/youtube-music-cli.rb` for the tap installation to work. Set `WINGETCREATE_TOKEN` and make sure `Involvex.YoutubeMusicCLI` exists in winget-pkgs for automated updates.
109
+
96
110
  ### From Source
97
111
 
98
112
  ```bash