Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Update changelog

Chocobozzzcc07364a5d63
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c00ec49cd2..0156551da7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,21 @@
# Changelog
+## v8.1.6
+
+### IMPORTANT NOTES
+
+ * Follow v8.1.0 IMPORTANT NOTES if you upgrade from PeerTube <= v8.0.2
+
+### SECURITY
+
+ * Fix SQL injection coming from actor inbox URL when updating actor follow scores
+ * Reject JSON-LD objects with special properties
+ * Restricts role assignment to administrators only
+ * Prevent external auth token replay
+ * Prevent SSRF on import and channel sync
+ * Stricter rate limit to ask password reset
+
+
## v8.1.5
### IMPORTANT NOTES
diff --git a/server/core/models/actor/actor-follow.ts b/server/core/models/actor/actor-follow.ts
index 5a623ca54d..880b4826e7 100644
--- a/server/core/models/actor/actor-follow.ts
+++ b/server/core/models/actor/actor-follow.ts
@@ -616,14 +616,19 @@ export class ActorFollowModel extends SequelizeModel<ActorFollowModel> {
}
static updateScore (inboxUrl: string, value: number, t?: Transaction) {
- const query = `UPDATE "actorFollow" SET "score" = LEAST("score" + ${value}, ${ACTOR_FOLLOW_SCORE.MAX}) ` +
+ const query = 'UPDATE "actorFollow" SET "score" = LEAST("score" + $value, $maxScore) ' +
'WHERE id IN (' +
'SELECT "actorFollow"."id" FROM "actorFollow" ' +
'INNER JOIN "actor" ON "actor"."id" = "actorFollow"."actorId" ' +
- `WHERE "actor"."inboxUrl" = '${inboxUrl}' OR "actor"."sharedInboxUrl" = '${inboxUrl}'` +
+ 'WHERE "actor"."inboxUrl" = $inboxUrl OR "actor"."sharedInboxUrl" = $inboxUrl' +
')'
const options = {
+ bind: {
+ inboxUrl,
+ maxScore: ACTOR_FOLLOW_SCORE.MAX,
+ value
+ },
type: QueryTypes.BULKUPDATE,
transaction: t
}
diff --git a/server/core/models/user/user-notification.ts b/server/core/models/user/user-notification.ts
index a4167cc04f..834b77f867 100644
--- a/server/core/models/user/user-notification.ts
+++ b/server/core/models/user/user-notification.ts
@@ -367,19 +367,24 @@ export class UserNotificationModel extends SequelizeModel<UserNotificationModel>
forUserId?: number
}) {
const id = forceNumber(options.id)
+ const bind: { id: number, forUserId?: number } = { id }
+
+ if (options.forUserId !== undefined) {
+ bind.forUserId = options.forUserId
+ }
function buildAccountWhereQuery (base: string) {
- const whereSuffix = options.forUserId
- ? ` AND "userNotification"."userId" = ${options.forUserId}`
+ const whereSuffix = options.forUserId !== undefined
+ ? ' AND "userNotification"."userId" = $forUserId'
: ''
if (options.type === 'account') {
return base +
- ` WHERE "account"."id" = ${id} ${whereSuffix}`
+ ` WHERE "account"."id" = $id ${whereSuffix}`
}
return base +
- ` WHERE "actor"."serverId" = ${id} ${whereSuffix}`
+ ` WHERE "actor"."serverId" = $id ${whereSuffix}`
}
const queries = [
@@ -426,7 +431,7 @@ export class UserNotificationModel extends SequelizeModel<UserNotificationModel>
const query = `DELETE FROM "userNotification" WHERE id IN (${queries.join(' UNION ')})`
- return UserNotificationModel.sequelize.query(query)
+ return UserNotificationModel.sequelize.query(query, { bind })
}
toFormattedJSON (this: UserNotificationModelForApi): UserNotification {