-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
security(cdc): fix some security problems #3700
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
/run-integration-test |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #3700 +/- ##
================================================
+ Coverage 56.9451% 57.4876% +0.5424%
================================================
Files 455 460 +5
Lines 54110 54824 +714
================================================
+ Hits 30813 31517 +704
+ Misses 20085 20041 -44
- Partials 3212 3266 +54 |
/run-all-tests |
/run-integration-test |
could you please take another look for this pr ? thanks 🧡🧡🧡 @hi-rustin @asddongmen |
@@ -72,7 +72,7 @@ func (c *Config) CompleteByOpts(sinkURI *url.URL, replicaConfig *config.ReplicaC | |||
params := sinkURI.Query() | |||
s := params.Get("partition-num") | |||
if s != "" { | |||
a, err := strconv.Atoi(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this is a security problem 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
becasue in L79 c.PartitionNum = int32(a)
try convert int to int32 😂
var line dataRow | ||
row := db.QueryRow(query) | ||
row := db.QueryRow(query, tableName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference in this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the old one may casue sql jnjection see more here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see details https://cwe.mitre.org/data/definitions/89.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
@@ -65,7 +65,7 @@ func newFileBackEnd(fileName string, serde encoding.SerializerDeserializer) (*fi | |||
} | |||
|
|||
func (f *fileBackEnd) reader() (backEndReader, error) { | |||
fd, err := os.OpenFile(f.fileName, os.O_RDWR, 0o644) | |||
fd, err := os.OpenFile(f.fileName, os.O_RDWR, 0o600) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @liuzix
Could you please take a look? Thanks! 💚 💙 💜 💛 ❤️
/run-integration-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: a142ea3
|
/run-dm-integration-tests |
What problem does this PR solve?
fix https://github.com/pingcap/ticdc/issues/3696
preview the fixed results here
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
Release note