Skip to content

Commit 7dece85

Browse files
committed
Bug Fixes | Security Vuln
title
1 parent d2c213b commit 7dece85

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

.vs/ScriptBloxAPI/v17/.suo

56 KB
Binary file not shown.

Methods/Authorization.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public static BoolStatus PingIdle(string authorization)
3333
/// <returns>A BoolStatus object indicating if the username change was successful and the response text.</returns>
3434
public static BoolStatus ChangeUsername(string authorization, string newUsername)
3535
{
36+
if (UserMethods.IsUsernameTaken(newUsername)) return new BoolStatus(false, "Username taken.");
37+
3638
HttpResponseMessage response = SendRequest("https://scriptblox.com/api/user/update", authorization, $"{{\"username\":\"{newUsername}\"}}");
3739

3840
return new BoolStatus(response.Content.ReadAsStringAsync().Result.Contains("Password updated!"), response.Content.ReadAsStringAsync().Result);

Methods/Scripts.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static List<ScriptObject> GetFrontPageScripts(int pageNumber = 1)
4747
throw new ScriptBloxException("An error has occured while fetching the json, please submit a bug report.");
4848
if (jsonReturn["message"] != null)
4949
throw new ScriptBloxException(jsonReturn.Value<string>("message"));
50-
if (jsonReturn["script"] == null)
50+
if (jsonReturn["scripts"] == null)
5151
throw new ScriptBloxException("Backend error occured.");
5252

5353
List<string> slugsToCheck = GetSlugsFromResults(jsonReturn);
@@ -82,7 +82,7 @@ public static List<ScriptObject> GetScriptsFromQuery(string searchQuery, int max
8282
throw new ScriptBloxException("An error has occured while fetching the json, please submit a bug report.");
8383
if (jsonReturn["message"] != null)
8484
throw new ScriptBloxException(jsonReturn.Value<string>("message"));
85-
if (jsonReturn["script"] == null)
85+
if (jsonReturn["scripts"] == null)
8686
throw new ScriptBloxException("Backend error occured.");
8787

8888
List<string> slugsToCheck = GetSlugsFromResults(jsonReturn);
@@ -102,13 +102,13 @@ public static List<ScriptObject> GetScriptsFromUser(string username)
102102
{
103103
List<ScriptObject> scriptsToReturn = new List<ScriptObject>();
104104

105-
JToken jsonReturn = JToken.Parse(MiscFunctions.HttpClient.GetStringAsync($"https://scriptblox.com/u/{username}").Result);
105+
JToken jsonReturn = JToken.Parse(MiscFunctions.HttpClient.GetStringAsync($"https://scriptblox.com/api/user/scripts/{username}?page=1").Result);
106106

107107
if (jsonReturn == null)
108108
throw new ScriptBloxException("An error has occured while fetching the json, please submit a bug report.");
109109
if (jsonReturn["message"] != null)
110110
throw new ScriptBloxException(jsonReturn.Value<string>("message"));
111-
if (jsonReturn["script"] == null)
111+
if (jsonReturn["scripts"] == null)
112112
throw new ScriptBloxException("Backend error occured.");
113113

114114
List<string> slugsToCheck = GetSlugsFromResults(jsonReturn.ToString());

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("4.0.0.0")]
36-
[assembly: AssemblyFileVersion("4.0.0.0")]
35+
[assembly: AssemblyVersion("4.0.1.0")]
36+
[assembly: AssemblyFileVersion("4.0.1.0")]

ScriptBloxAPI.nuspec

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,11 @@
1111
<projectUrl>https://github.com/IrisV3rm/ScriptBloxAPI</projectUrl>
1212
<description>$description$</description>
1313
<releaseNotes>
14-
- 4.0.0
14+
- Security Update
15+
- 4.0.1
1516

16-
- 2 New Data Types
17-
-Notification Object
18-
-BoolStatus
19-
20-
- 3 New Method Handles
21-
- Authorization (See Docs)
22-
- Commenting
23-
- Notification
24-
- 2 New Methods in User Methods
25-
- GetUserIdFromName
26-
- GetUserFromUserId
17+
- Fixed a security vulnerability reported
18+
- Fixed reported bug with Scripts Methods
2719

2820
</releaseNotes>
2921
<copyright>$copyright$</copyright>

0 commit comments

Comments
 (0)