Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions adapters/sqlstore/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"encoding/json"
"regexp"

"github.com/luno/jettison/errors"
"github.com/luno/jettison/j"
Expand Down Expand Up @@ -87,6 +88,9 @@ func (s *SQLStore) insertOutboxEvent(
workflowName string,
data []byte,
) (int64, error) {
if !regexp.MustCompile(`^[a-zA-Z0-9_]+$`).MatchString(s.outboxTableName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would imply the attacker has access to the source code. Will close as this doesnt prevent the attacker then from removing this check.

return 0, errors.New("invalid table name")
}
resp, err := tx.ExecContext(ctx, "insert into "+s.outboxTableName+" set "+
" id=?, workflow_name=?, data=?, created_at=now() ",
id,
Expand Down