mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
fixes #789 - Security Issue: API allows access to any folder of the PC running MediaBrowser
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
@@ -152,7 +153,7 @@ namespace MediaBrowser.Api
|
||||
/// <summary>
|
||||
/// Class UsersService
|
||||
/// </summary>
|
||||
public class UserService : BaseApiService
|
||||
public class UserService : BaseApiService, IHasAuthorization
|
||||
{
|
||||
/// <summary>
|
||||
/// The _XML serializer
|
||||
@@ -166,6 +167,8 @@ namespace MediaBrowser.Api
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly ISessionManager _sessionMananger;
|
||||
|
||||
public IAuthorizationContext AuthorizationContext { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserService" /> class.
|
||||
/// </summary>
|
||||
@@ -295,7 +298,7 @@ namespace MediaBrowser.Api
|
||||
throw new ResourceNotFoundException("User not found");
|
||||
}
|
||||
|
||||
var auth = AuthorizationRequestFilterAttribute.GetAuthorization(Request);
|
||||
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
|
||||
|
||||
// Login in the old way if the header is missing
|
||||
if (string.IsNullOrEmpty(auth.Client) ||
|
||||
|
||||
Reference in New Issue
Block a user