Skip to content
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

throw at invalid profile name in shared ini file #3585

Merged
merged 1 commit into from Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-Credentials-74d3274e.json
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "Credentials",
"description": "SDK will throw if shared ini file's profile name can be resolved to __proto__"
}
5 changes: 5 additions & 0 deletions lib/util.js
Expand Up @@ -219,6 +219,11 @@ var util = {
var section = line.match(/^\s*\[([^\[\]]+)\]\s*$/);
if (section) {
currentSection = section[1];
if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') {
throw util.error(
new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.')
);
}
} else if (currentSection) {
var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/);
if (item) {
Expand Down
31 changes: 27 additions & 4 deletions test/util.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.