Skip to content

Commit dd83d67

Browse files
authored
throw at invalid profile name in shared ini file (#3585)
1 parent ee0c5a3 commit dd83d67

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "Credentials",
4+
"description": "SDK will throw if shared ini file's profile name can be resolved to __proto__"
5+
}

lib/util.js

+5
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ var util = {
219219
var section = line.match(/^\s*\[([^\[\]]+)\]\s*$/);
220220
if (section) {
221221
currentSection = section[1];
222+
if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') {
223+
throw util.error(
224+
new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.')
225+
);
226+
}
222227
} else if (currentSection) {
223228
var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/);
224229
if (item) {

test/util.spec.js

+27-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)