Skip to content

Commit

Permalink
fix: fixing SSTI by removing eval style format string
Browse files Browse the repository at this point in the history
  • Loading branch information
nom4dv3 committed Aug 13, 2024
1 parent 29545ed commit 678dc5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/orap/task/storable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export abstract class TaskStorable extends TaskBase {
static async _load<T extends TaskStorable>(this: Constructor<T>, sm: StoreManager): Promise<T> {
const instance = new this()
// get all task keys
const keys = await sm.keys(`${instance.getTaskPrefix()}*`, true)
const keys = await sm.keys(instance.getTaskPrefix() + '*', true)
// get the first task (del when finish)
const serializedTask: string = (await sm.get(keys[0]))! // never undefined ensured by keys isWait=true

Expand Down
2 changes: 1 addition & 1 deletion packages/utils/common/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Logger {
const method = type === 'info' ? 'log' : type
const format = () => {
const tag = this.tagMap[type]
return `${colors.dim(this.timeFormatter.format(new Date()))} ${tag} ${msg}`
return colors.dim(this.timeFormatter.format(new Date())) + ' ' + tag + ' ' + msg;
}
console[method](format())
}
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/w3/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function getEventSignature(abi: any[], eventName: string): string {
const eventFragment = iface.getEvent(eventName)

if (!eventFragment)
throw new Error(`event ${eventName} not found.`)
throw new Error("event " + eventName + " not found.")

// Return the event topic (which is the event signature)
return eventFragment.topicHash
Expand Down

0 comments on commit 678dc5f

Please sign in to comment.