cve_id
stringlengths 13
16
| obtain_all_privilege
stringclasses 3
values | obtain_user_privilege
stringclasses 2
values | obtain_other_privilege
stringclasses 2
values | user_interaction_required
stringclasses 3
values | cvss2_vector_string
stringclasses 106
values | cvss2_access_vector
stringclasses 4
values | cvss2_access_complexity
stringclasses 4
values | cvss2_authentication
stringclasses 3
values | cvss2_confidentiality_impact
stringclasses 4
values | cvss2_integrity_impact
stringclasses 4
values | cvss2_availability_impact
stringclasses 4
values | cvss2_base_score
stringclasses 50
values | cvss3_vector_string
stringclasses 226
values | cvss3_attack_vector
stringclasses 5
values | cvss3_attack_complexity
stringclasses 3
values | cvss3_privileges_required
stringclasses 4
values | cvss3_user_interaction
stringclasses 3
values | cvss3_scope
stringclasses 3
values | cvss3_confidentiality_impact
stringclasses 4
values | cvss3_integrity_impact
stringclasses 4
values | cvss3_availability_impact
stringclasses 4
values | cvss3_base_score
stringclasses 55
values | cvss3_base_severity
stringclasses 5
values | exploitability_score
stringclasses 22
values | impact_score
stringclasses 15
values | ac_insuf_info
stringclasses 3
values | reference_json
stringlengths 221
23.3k
| problemtype_json
stringclasses 200
values | severity
stringclasses 4
values | cve_nodes
stringlengths 2
33.1k
| cve_description
stringlengths 64
1.99k
| cve_last_modified_date
stringlengths 17
17
| cve_published_date
stringlengths 17
17
| cwe_name
stringclasses 125
values | cwe_description
stringclasses 124
values | cwe_extended_description
stringclasses 95
values | cwe_url
stringclasses 124
values | cwe_is_category
int64 0
1
| commit_author
stringlengths 0
34
| commit_author_date
stringlengths 25
25
| commit_msg
stringlengths 0
13.3k
| commit_hash
stringlengths 40
40
| commit_is_merge
stringclasses 1
value | repo_name
stringclasses 467
values | repo_description
stringclasses 459
values | repo_date_created
stringclasses 467
values | repo_date_last_push
stringclasses 467
values | repo_homepage
stringclasses 294
values | repo_owner
stringclasses 470
values | repo_stars
stringclasses 406
values | repo_forks
stringclasses 352
values | function_name
stringlengths 3
120
| function_signature
stringlengths 6
640
| function_parameters
stringlengths 2
302
| function
stringlengths 12
114k
| function_token_count
stringlengths 1
5
| function_before_change
stringclasses 1
value | labels
int64 1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CVE-2019-19959 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:P/A:N | NETWORK | LOW | NONE | NONE | PARTIAL | NONE | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | HIGH | NONE | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/sqlite/sqlite/commit/1e490c4ca6b43a9cf8637d695907888349f69bec', 'name': 'https://github.com/sqlite/sqlite/commit/1e490c4ca6b43a9cf8637d695907888349f69bec', 'refsource': 'MISC', 'tags': ['Third Party Advisory']}, {'url': 'https://github.com/sqlite/sqlite/commit/d8f2d46cbc9925e034a68aaaf60aad788d9373c1', 'name': 'https://github.com/sqlite/sqlite/commit/d8f2d46cbc9925e034a68aaaf60aad788d9373c1', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://security.netapp.com/advisory/ntap-20200204-0001/', 'name': 'https://security.netapp.com/advisory/ntap-20200204-0001/', 'refsource': 'CONFIRM', 'tags': ['Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4298-1/', 'name': 'USN-4298-1', 'refsource': 'UBUNTU', 'tags': ['Third Party Advisory']}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': ['Third Party Advisory']}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}, {'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:16.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:18.04:*:*:*:lts:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:o:canonical:ubuntu_linux:19.10:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': "ext/misc/zipfile.c in SQLite 3.30.1 mishandles certain uses of INSERT INTO in situations involving embedded '\\0' characters in filenames, leading to a memory-management error that can be detected by (for example) valgrind."}] | 2020-11-09T21:47Z | 2020-01-03T22:15Z | Other | NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | drh | 2019-12-23 21:04:33+00:00 | Fix the zipfile() function in the zipfile extension so that it is able to
deal with goofy filenames that contain embedded zeros.
FossilOrigin-Name: cc0fb00a128fd0773db5ff7891f7aa577a3671d570166d2cbb30df922344adcf | d8f2d46cbc9925e034a68aaaf60aad788d9373c1 | False | sqlite/sqlite | Official Git mirror of the SQLite source tree | 2019-03-18 12:21:01 | 2022-08-27 16:17:07 | sqlite | 2821.0 | 490.0 | zipfileUpdate | zipfileUpdate( sqlite3_vtab * pVtab , int nVal , sqlite3_value ** apVal , sqlite_int64 * pRowid) | ['pVtab', 'nVal', 'apVal', 'pRowid'] | static int zipfileUpdate(
sqlite3_vtab *pVtab,
int nVal,
sqlite3_value **apVal,
sqlite_int64 *pRowid
){
ZipfileTab *pTab = (ZipfileTab*)pVtab;
int rc = SQLITE_OK; /* Return Code */
ZipfileEntry *pNew = 0; /* New in-memory CDS entry */
u32 mode = 0; /* Mode for new entry */
u32 mTime = 0; /* Modification time for new entry */
i64 sz = 0; /* Uncompressed size */
const char *zPath = 0; /* Path for new entry */
int nPath = 0; /* strlen(zPath) */
const u8 *pData = 0; /* Pointer to buffer containing content */
int nData = 0; /* Size of pData buffer in bytes */
int iMethod = 0; /* Compression method for new entry */
u8 *pFree = 0; /* Free this */
char *zFree = 0; /* Also free this */
ZipfileEntry *pOld = 0;
ZipfileEntry *pOld2 = 0;
int bUpdate = 0; /* True for an update that modifies "name" */
int bIsDir = 0;
u32 iCrc32 = 0;
if( pTab->pWriteFd==0 ){
rc = zipfileBegin(pVtab);
if( rc!=SQLITE_OK ) return rc;
}
/* If this is a DELETE or UPDATE, find the archive entry to delete. */
if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
const char *zDelete = (const char*)sqlite3_value_text(apVal[0]);
int nDelete = (int)strlen(zDelete);
if( nVal>1 ){
const char *zUpdate = (const char*)sqlite3_value_text(apVal[1]);
if( zUpdate && zipfileComparePath(zUpdate, zDelete, nDelete)!=0 ){
bUpdate = 1;
}
}
for(pOld=pTab->pFirstEntry; 1; pOld=pOld->pNext){
if( zipfileComparePath(pOld->cds.zFile, zDelete, nDelete)==0 ){
break;
}
assert( pOld->pNext );
}
}
if( nVal>1 ){
/* Check that "sz" and "rawdata" are both NULL: */
if( sqlite3_value_type(apVal[5])!=SQLITE_NULL ){
zipfileTableErr(pTab, "sz must be NULL");
rc = SQLITE_CONSTRAINT;
}
if( sqlite3_value_type(apVal[6])!=SQLITE_NULL ){
zipfileTableErr(pTab, "rawdata must be NULL");
rc = SQLITE_CONSTRAINT;
}
if( rc==SQLITE_OK ){
if( sqlite3_value_type(apVal[7])==SQLITE_NULL ){
/* data=NULL. A directory */
bIsDir = 1;
}else{
/* Value specified for "data", and possibly "method". This must be
** a regular file or a symlink. */
const u8 *aIn = sqlite3_value_blob(apVal[7]);
int nIn = sqlite3_value_bytes(apVal[7]);
int bAuto = sqlite3_value_type(apVal[8])==SQLITE_NULL;
iMethod = sqlite3_value_int(apVal[8]);
sz = nIn;
pData = aIn;
nData = nIn;
if( iMethod!=0 && iMethod!=8 ){
zipfileTableErr(pTab, "unknown compression method: %d", iMethod);
rc = SQLITE_CONSTRAINT;
}else{
if( bAuto || iMethod ){
int nCmp;
rc = zipfileDeflate(aIn, nIn, &pFree, &nCmp, &pTab->base.zErrMsg);
if( rc==SQLITE_OK ){
if( iMethod || nCmp<nIn ){
iMethod = 8;
pData = pFree;
nData = nCmp;
}
}
}
iCrc32 = crc32(0, aIn, nIn);
}
}
}
if( rc==SQLITE_OK ){
rc = zipfileGetMode(apVal[3], bIsDir, &mode, &pTab->base.zErrMsg);
}
if( rc==SQLITE_OK ){
zPath = (const char*)sqlite3_value_text(apVal[2]);
if( zPath==0 ) zPath = "";
nPath = (int)strlen(zPath);
mTime = zipfileGetTime(apVal[4]);
}
if( rc==SQLITE_OK && bIsDir ){
/* For a directory, check that the last character in the path is a
** '/'. This appears to be required for compatibility with info-zip
** (the unzip command on unix). It does not create directories
** otherwise. */
if( zPath[nPath-1]!='/' ){
zFree = sqlite3_mprintf("%s/", zPath);
if( zFree==0 ){ rc = SQLITE_NOMEM; }
zPath = (const char*)zFree;
nPath++;
}
}
/* Check that we're not inserting a duplicate entry -OR- updating an
** entry with a path, thereby making it into a duplicate. */
if( (pOld==0 || bUpdate) && rc==SQLITE_OK ){
ZipfileEntry *p;
for(p=pTab->pFirstEntry; p; p=p->pNext){
if( zipfileComparePath(p->cds.zFile, zPath, nPath)==0 ){
switch( sqlite3_vtab_on_conflict(pTab->db) ){
case SQLITE_IGNORE: {
goto zipfile_update_done;
}
case SQLITE_REPLACE: {
pOld2 = p;
break;
}
default: {
zipfileTableErr(pTab, "duplicate name: \"%s\"", zPath);
rc = SQLITE_CONSTRAINT;
break;
}
}
break;
}
}
}
if( rc==SQLITE_OK ){
/* Create the new CDS record. */
pNew = zipfileNewEntry(zPath);
if( pNew==0 ){
rc = SQLITE_NOMEM;
}else{
pNew->cds.iVersionMadeBy = ZIPFILE_NEWENTRY_MADEBY;
pNew->cds.iVersionExtract = ZIPFILE_NEWENTRY_REQUIRED;
pNew->cds.flags = ZIPFILE_NEWENTRY_FLAGS;
pNew->cds.iCompression = (u16)iMethod;
zipfileMtimeToDos(&pNew->cds, mTime);
pNew->cds.crc32 = iCrc32;
pNew->cds.szCompressed = nData;
pNew->cds.szUncompressed = (u32)sz;
pNew->cds.iExternalAttr = (mode<<16);
pNew->cds.iOffset = (u32)pTab->szCurrent;
pNew->cds.nFile = (u16)nPath;
pNew->mUnixTime = (u32)mTime;
rc = zipfileAppendEntry(pTab, pNew, pData, nData);
zipfileAddEntry(pTab, pOld, pNew);
}
}
}
if( rc==SQLITE_OK && (pOld || pOld2) ){
ZipfileCsr *pCsr;
for(pCsr=pTab->pCsrList; pCsr; pCsr=pCsr->pCsrNext){
if( pCsr->pCurrent && (pCsr->pCurrent==pOld || pCsr->pCurrent==pOld2) ){
pCsr->pCurrent = pCsr->pCurrent->pNext;
pCsr->bNoop = 1;
}
}
zipfileRemoveEntryFromList(pTab, pOld);
zipfileRemoveEntryFromList(pTab, pOld2);
}
zipfile_update_done:
sqlite3_free(pFree);
sqlite3_free(zFree);
return rc;
} | 1053 | True | 1 |
|
CVE-2019-20218 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/sqlite/sqlite/commit/a6c1a71cde082e09750465d5675699062922e387', 'name': 'https://github.com/sqlite/sqlite/commit/a6c1a71cde082e09750465d5675699062922e387', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4298-1/', 'name': 'USN-4298-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202007-26', 'name': 'GLSA-202007-26', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00037.html', 'name': '[debian-lts-announce] 20200822 [SECURITY] [DLA 2340-1] sqlite3 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00016.html', 'name': '[debian-lts-announce] 20201210 [SECURITY] [DLA 2340-2] sqlite3 regression update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}, {'lang': 'en', 'value': 'CWE-755'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'selectExpander in select.c in SQLite 3.30.1 proceeds with WITH stack unwinding even after a parsing error.'}] | 2020-12-11T00:15Z | 2020-01-02T14:16Z | Improper Handling of Exceptional Conditions | The software does not handle or incorrectly handles an exceptional condition. | https://cwe.mitre.org/data/definitions/755.html | 0 | dan | 2019-12-27 20:54:42+00:00 | Do not attempt to unwind the WITH stack in the Parse object following an error. This fixes a separate case to [de6e6d68].
FossilOrigin-Name: d29edef93451cc67a5d69c1cce1b1832d9ca8fff1f600afdd51338b74d077b92 | a6c1a71cde082e09750465d5675699062922e387 | False | sqlite/sqlite | Official Git mirror of the SQLite source tree | 2019-03-18 12:21:01 | 2022-08-27 16:17:07 | sqlite | 2821.0 | 490.0 | selectExpander | selectExpander( Walker * pWalker , Select * p) | ['pWalker', 'p'] | static int selectExpander(Walker *pWalker, Select *p){
Parse *pParse = pWalker->pParse;
int i, j, k;
SrcList *pTabList;
ExprList *pEList;
struct SrcList_item *pFrom;
sqlite3 *db = pParse->db;
Expr *pE, *pRight, *pExpr;
u16 selFlags = p->selFlags;
u32 elistFlags = 0;
p->selFlags |= SF_Expanded;
if( db->mallocFailed ){
return WRC_Abort;
}
assert( p->pSrc!=0 );
if( (selFlags & SF_Expanded)!=0 ){
return WRC_Prune;
}
if( pWalker->eCode ){
/* Renumber selId because it has been copied from a view */
p->selId = ++pParse->nSelect;
}
pTabList = p->pSrc;
pEList = p->pEList;
sqlite3WithPush(pParse, p->pWith, 0);
/* Make sure cursor numbers have been assigned to all entries in
** the FROM clause of the SELECT statement.
*/
sqlite3SrcListAssignCursors(pParse, pTabList);
/* Look up every table named in the FROM clause of the select. If
** an entry of the FROM clause is a subquery instead of a table or view,
** then create a transient table structure to describe the subquery.
*/
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
Table *pTab;
assert( pFrom->fg.isRecursive==0 || pFrom->pTab!=0 );
if( pFrom->fg.isRecursive ) continue;
assert( pFrom->pTab==0 );
#ifndef SQLITE_OMIT_CTE
if( withExpand(pWalker, pFrom) ) return WRC_Abort;
if( pFrom->pTab ) {} else
#endif
if( pFrom->zName==0 ){
#ifndef SQLITE_OMIT_SUBQUERY
Select *pSel = pFrom->pSelect;
/* A sub-query in the FROM clause of a SELECT */
assert( pSel!=0 );
assert( pFrom->pTab==0 );
if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort;
if( sqlite3ExpandSubquery(pParse, pFrom) ) return WRC_Abort;
#endif
}else{
/* An ordinary table or view name in the FROM clause */
assert( pFrom->pTab==0 );
pFrom->pTab = pTab = sqlite3LocateTableItem(pParse, 0, pFrom);
if( pTab==0 ) return WRC_Abort;
if( pTab->nTabRef>=0xffff ){
sqlite3ErrorMsg(pParse, "too many references to \"%s\": max 65535",
pTab->zName);
pFrom->pTab = 0;
return WRC_Abort;
}
pTab->nTabRef++;
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){
return WRC_Abort;
}
#if !defined(SQLITE_OMIT_VIEW) || !defined (SQLITE_OMIT_VIRTUALTABLE)
if( IsVirtual(pTab) || pTab->pSelect ){
i16 nCol;
u8 eCodeOrig = pWalker->eCode;
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
assert( pFrom->pSelect==0 );
if( pTab->pSelect && (db->flags & SQLITE_EnableView)==0 ){
sqlite3ErrorMsg(pParse, "access to view \"%s\" prohibited",
pTab->zName);
}
pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
nCol = pTab->nCol;
pTab->nCol = -1;
pWalker->eCode = 1; /* Turn on Select.selId renumbering */
sqlite3WalkSelect(pWalker, pFrom->pSelect);
pWalker->eCode = eCodeOrig;
pTab->nCol = nCol;
}
#endif
}
/* Locate the index named by the INDEXED BY clause, if any. */
if( sqlite3IndexedByLookup(pParse, pFrom) ){
return WRC_Abort;
}
}
/* Process NATURAL keywords, and ON and USING clauses of joins.
*/
if( db->mallocFailed || sqliteProcessJoin(pParse, p) ){
return WRC_Abort;
}
/* For every "*" that occurs in the column list, insert the names of
** all columns in all tables. And for every TABLE.* insert the names
** of all columns in TABLE. The parser inserted a special expression
** with the TK_ASTERISK operator for each "*" that it found in the column
** list. The following code just has to locate the TK_ASTERISK
** expressions and expand each one to the list of all columns in
** all tables.
**
** The first loop just checks to see if there are any "*" operators
** that need expanding.
*/
for(k=0; k<pEList->nExpr; k++){
pE = pEList->a[k].pExpr;
if( pE->op==TK_ASTERISK ) break;
assert( pE->op!=TK_DOT || pE->pRight!=0 );
assert( pE->op!=TK_DOT || (pE->pLeft!=0 && pE->pLeft->op==TK_ID) );
if( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK ) break;
elistFlags |= pE->flags;
}
if( k<pEList->nExpr ){
/*
** If we get here it means the result set contains one or more "*"
** operators that need to be expanded. Loop through each expression
** in the result set and expand them one by one.
*/
struct ExprList_item *a = pEList->a;
ExprList *pNew = 0;
int flags = pParse->db->flags;
int longNames = (flags & SQLITE_FullColNames)!=0
&& (flags & SQLITE_ShortColNames)==0;
for(k=0; k<pEList->nExpr; k++){
pE = a[k].pExpr;
elistFlags |= pE->flags;
pRight = pE->pRight;
assert( pE->op!=TK_DOT || pRight!=0 );
if( pE->op!=TK_ASTERISK
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK)
){
/* This particular expression does not need to be expanded.
*/
pNew = sqlite3ExprListAppend(pParse, pNew, a[k].pExpr);
if( pNew ){
pNew->a[pNew->nExpr-1].zName = a[k].zName;
pNew->a[pNew->nExpr-1].zSpan = a[k].zSpan;
a[k].zName = 0;
a[k].zSpan = 0;
}
a[k].pExpr = 0;
}else{
/* This expression is a "*" or a "TABLE.*" and needs to be
** expanded. */
int tableSeen = 0; /* Set to 1 when TABLE matches */
char *zTName = 0; /* text of name of TABLE */
if( pE->op==TK_DOT ){
assert( pE->pLeft!=0 );
assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
zTName = pE->pLeft->u.zToken;
}
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
Table *pTab = pFrom->pTab;
Select *pSub = pFrom->pSelect;
char *zTabName = pFrom->zAlias;
const char *zSchemaName = 0;
int iDb;
if( zTabName==0 ){
zTabName = pTab->zName;
}
if( db->mallocFailed ) break;
if( pSub==0 || (pSub->selFlags & SF_NestedFrom)==0 ){
pSub = 0;
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){
continue;
}
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
zSchemaName = iDb>=0 ? db->aDb[iDb].zDbSName : "*";
}
for(j=0; j<pTab->nCol; j++){
char *zName = pTab->aCol[j].zName;
char *zColname; /* The computed column name */
char *zToFree; /* Malloced string that needs to be freed */
Token sColname; /* Computed column name as a token */
assert( zName );
if( zTName && pSub
&& sqlite3MatchSpanName(pSub->pEList->a[j].zSpan, 0, zTName, 0)==0
){
continue;
}
/* If a column is marked as 'hidden', omit it from the expanded
** result-set list unless the SELECT has the SF_IncludeHidden
** bit set.
*/
if( (p->selFlags & SF_IncludeHidden)==0
&& IsHiddenColumn(&pTab->aCol[j])
){
continue;
}
tableSeen = 1;
if( i>0 && zTName==0 ){
if( (pFrom->fg.jointype & JT_NATURAL)!=0
&& tableAndColumnIndex(pTabList, i, zName, 0, 0)
){
/* In a NATURAL join, omit the join columns from the
** table to the right of the join */
continue;
}
if( sqlite3IdListIndex(pFrom->pUsing, zName)>=0 ){
/* In a join with a USING clause, omit columns in the
** using clause from the table on the right. */
continue;
}
}
pRight = sqlite3Expr(db, TK_ID, zName);
zColname = zName;
zToFree = 0;
if( longNames || pTabList->nSrc>1 ){
Expr *pLeft;
pLeft = sqlite3Expr(db, TK_ID, zTabName);
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
if( zSchemaName ){
pLeft = sqlite3Expr(db, TK_ID, zSchemaName);
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
}
if( longNames ){
zColname = sqlite3MPrintf(db, "%s.%s", zTabName, zName);
zToFree = zColname;
}
}else{
pExpr = pRight;
}
pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
sqlite3TokenInit(&sColname, zColname);
sqlite3ExprListSetName(pParse, pNew, &sColname, 0);
if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){
struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
if( pSub ){
pX->zSpan = sqlite3DbStrDup(db, pSub->pEList->a[j].zSpan);
testcase( pX->zSpan==0 );
}else{
pX->zSpan = sqlite3MPrintf(db, "%s.%s.%s",
zSchemaName, zTabName, zColname);
testcase( pX->zSpan==0 );
}
pX->bSpanIsTab = 1;
}
sqlite3DbFree(db, zToFree);
}
}
if( !tableSeen ){
if( zTName ){
sqlite3ErrorMsg(pParse, "no such table: %s", zTName);
}else{
sqlite3ErrorMsg(pParse, "no tables specified");
}
}
}
}
sqlite3ExprListDelete(db, pEList);
p->pEList = pNew;
}
if( p->pEList ){
if( p->pEList->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){
sqlite3ErrorMsg(pParse, "too many columns in result set");
return WRC_Abort;
}
if( (elistFlags & (EP_HasFunc|EP_Subquery))!=0 ){
p->selFlags |= SF_ComplexResult;
}
}
return WRC_Continue;
} | 1612 | True | 1 |
||
CVE-2019-20218 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/sqlite/sqlite/commit/a6c1a71cde082e09750465d5675699062922e387', 'name': 'https://github.com/sqlite/sqlite/commit/a6c1a71cde082e09750465d5675699062922e387', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://usn.ubuntu.com/4298-1/', 'name': 'USN-4298-1', 'refsource': 'UBUNTU', 'tags': []}, {'url': 'https://www.oracle.com/security-alerts/cpuapr2020.html', 'name': 'N/A', 'refsource': 'N/A', 'tags': []}, {'url': 'https://security.gentoo.org/glsa/202007-26', 'name': 'GLSA-202007-26', 'refsource': 'GENTOO', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/08/msg00037.html', 'name': '[debian-lts-announce] 20200822 [SECURITY] [DLA 2340-1] sqlite3 security update', 'refsource': 'MLIST', 'tags': []}, {'url': 'https://lists.debian.org/debian-lts-announce/2020/12/msg00016.html', 'name': '[debian-lts-announce] 20201210 [SECURITY] [DLA 2340-2] sqlite3 regression update', 'refsource': 'MLIST', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'NVD-CWE-Other'}, {'lang': 'en', 'value': 'CWE-755'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:sqlite:sqlite:3.30.1:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'selectExpander in select.c in SQLite 3.30.1 proceeds with WITH stack unwinding even after a parsing error.'}] | 2020-12-11T00:15Z | 2020-01-02T14:16Z | Other | NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset. | Insufficient Information | https://nvd.nist.gov/vuln/categories | 0 | dan | 2019-12-27 20:54:42+00:00 | Do not attempt to unwind the WITH stack in the Parse object following an error. This fixes a separate case to [de6e6d68].
FossilOrigin-Name: d29edef93451cc67a5d69c1cce1b1832d9ca8fff1f600afdd51338b74d077b92 | a6c1a71cde082e09750465d5675699062922e387 | False | sqlite/sqlite | Official Git mirror of the SQLite source tree | 2019-03-18 12:21:01 | 2022-08-27 16:17:07 | sqlite | 2821.0 | 490.0 | selectExpander | selectExpander( Walker * pWalker , Select * p) | ['pWalker', 'p'] | static int selectExpander(Walker *pWalker, Select *p){
Parse *pParse = pWalker->pParse;
int i, j, k;
SrcList *pTabList;
ExprList *pEList;
struct SrcList_item *pFrom;
sqlite3 *db = pParse->db;
Expr *pE, *pRight, *pExpr;
u16 selFlags = p->selFlags;
u32 elistFlags = 0;
p->selFlags |= SF_Expanded;
if( db->mallocFailed ){
return WRC_Abort;
}
assert( p->pSrc!=0 );
if( (selFlags & SF_Expanded)!=0 ){
return WRC_Prune;
}
if( pWalker->eCode ){
/* Renumber selId because it has been copied from a view */
p->selId = ++pParse->nSelect;
}
pTabList = p->pSrc;
pEList = p->pEList;
sqlite3WithPush(pParse, p->pWith, 0);
/* Make sure cursor numbers have been assigned to all entries in
** the FROM clause of the SELECT statement.
*/
sqlite3SrcListAssignCursors(pParse, pTabList);
/* Look up every table named in the FROM clause of the select. If
** an entry of the FROM clause is a subquery instead of a table or view,
** then create a transient table structure to describe the subquery.
*/
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
Table *pTab;
assert( pFrom->fg.isRecursive==0 || pFrom->pTab!=0 );
if( pFrom->fg.isRecursive ) continue;
assert( pFrom->pTab==0 );
#ifndef SQLITE_OMIT_CTE
if( withExpand(pWalker, pFrom) ) return WRC_Abort;
if( pFrom->pTab ) {} else
#endif
if( pFrom->zName==0 ){
#ifndef SQLITE_OMIT_SUBQUERY
Select *pSel = pFrom->pSelect;
/* A sub-query in the FROM clause of a SELECT */
assert( pSel!=0 );
assert( pFrom->pTab==0 );
if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort;
if( sqlite3ExpandSubquery(pParse, pFrom) ) return WRC_Abort;
#endif
}else{
/* An ordinary table or view name in the FROM clause */
assert( pFrom->pTab==0 );
pFrom->pTab = pTab = sqlite3LocateTableItem(pParse, 0, pFrom);
if( pTab==0 ) return WRC_Abort;
if( pTab->nTabRef>=0xffff ){
sqlite3ErrorMsg(pParse, "too many references to \"%s\": max 65535",
pTab->zName);
pFrom->pTab = 0;
return WRC_Abort;
}
pTab->nTabRef++;
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){
return WRC_Abort;
}
#if !defined(SQLITE_OMIT_VIEW) || !defined (SQLITE_OMIT_VIRTUALTABLE)
if( IsVirtual(pTab) || pTab->pSelect ){
i16 nCol;
u8 eCodeOrig = pWalker->eCode;
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
assert( pFrom->pSelect==0 );
if( pTab->pSelect && (db->flags & SQLITE_EnableView)==0 ){
sqlite3ErrorMsg(pParse, "access to view \"%s\" prohibited",
pTab->zName);
}
pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
nCol = pTab->nCol;
pTab->nCol = -1;
pWalker->eCode = 1; /* Turn on Select.selId renumbering */
sqlite3WalkSelect(pWalker, pFrom->pSelect);
pWalker->eCode = eCodeOrig;
pTab->nCol = nCol;
}
#endif
}
/* Locate the index named by the INDEXED BY clause, if any. */
if( sqlite3IndexedByLookup(pParse, pFrom) ){
return WRC_Abort;
}
}
/* Process NATURAL keywords, and ON and USING clauses of joins.
*/
if( db->mallocFailed || sqliteProcessJoin(pParse, p) ){
return WRC_Abort;
}
/* For every "*" that occurs in the column list, insert the names of
** all columns in all tables. And for every TABLE.* insert the names
** of all columns in TABLE. The parser inserted a special expression
** with the TK_ASTERISK operator for each "*" that it found in the column
** list. The following code just has to locate the TK_ASTERISK
** expressions and expand each one to the list of all columns in
** all tables.
**
** The first loop just checks to see if there are any "*" operators
** that need expanding.
*/
for(k=0; k<pEList->nExpr; k++){
pE = pEList->a[k].pExpr;
if( pE->op==TK_ASTERISK ) break;
assert( pE->op!=TK_DOT || pE->pRight!=0 );
assert( pE->op!=TK_DOT || (pE->pLeft!=0 && pE->pLeft->op==TK_ID) );
if( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK ) break;
elistFlags |= pE->flags;
}
if( k<pEList->nExpr ){
/*
** If we get here it means the result set contains one or more "*"
** operators that need to be expanded. Loop through each expression
** in the result set and expand them one by one.
*/
struct ExprList_item *a = pEList->a;
ExprList *pNew = 0;
int flags = pParse->db->flags;
int longNames = (flags & SQLITE_FullColNames)!=0
&& (flags & SQLITE_ShortColNames)==0;
for(k=0; k<pEList->nExpr; k++){
pE = a[k].pExpr;
elistFlags |= pE->flags;
pRight = pE->pRight;
assert( pE->op!=TK_DOT || pRight!=0 );
if( pE->op!=TK_ASTERISK
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK)
){
/* This particular expression does not need to be expanded.
*/
pNew = sqlite3ExprListAppend(pParse, pNew, a[k].pExpr);
if( pNew ){
pNew->a[pNew->nExpr-1].zName = a[k].zName;
pNew->a[pNew->nExpr-1].zSpan = a[k].zSpan;
a[k].zName = 0;
a[k].zSpan = 0;
}
a[k].pExpr = 0;
}else{
/* This expression is a "*" or a "TABLE.*" and needs to be
** expanded. */
int tableSeen = 0; /* Set to 1 when TABLE matches */
char *zTName = 0; /* text of name of TABLE */
if( pE->op==TK_DOT ){
assert( pE->pLeft!=0 );
assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
zTName = pE->pLeft->u.zToken;
}
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
Table *pTab = pFrom->pTab;
Select *pSub = pFrom->pSelect;
char *zTabName = pFrom->zAlias;
const char *zSchemaName = 0;
int iDb;
if( zTabName==0 ){
zTabName = pTab->zName;
}
if( db->mallocFailed ) break;
if( pSub==0 || (pSub->selFlags & SF_NestedFrom)==0 ){
pSub = 0;
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){
continue;
}
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
zSchemaName = iDb>=0 ? db->aDb[iDb].zDbSName : "*";
}
for(j=0; j<pTab->nCol; j++){
char *zName = pTab->aCol[j].zName;
char *zColname; /* The computed column name */
char *zToFree; /* Malloced string that needs to be freed */
Token sColname; /* Computed column name as a token */
assert( zName );
if( zTName && pSub
&& sqlite3MatchSpanName(pSub->pEList->a[j].zSpan, 0, zTName, 0)==0
){
continue;
}
/* If a column is marked as 'hidden', omit it from the expanded
** result-set list unless the SELECT has the SF_IncludeHidden
** bit set.
*/
if( (p->selFlags & SF_IncludeHidden)==0
&& IsHiddenColumn(&pTab->aCol[j])
){
continue;
}
tableSeen = 1;
if( i>0 && zTName==0 ){
if( (pFrom->fg.jointype & JT_NATURAL)!=0
&& tableAndColumnIndex(pTabList, i, zName, 0, 0)
){
/* In a NATURAL join, omit the join columns from the
** table to the right of the join */
continue;
}
if( sqlite3IdListIndex(pFrom->pUsing, zName)>=0 ){
/* In a join with a USING clause, omit columns in the
** using clause from the table on the right. */
continue;
}
}
pRight = sqlite3Expr(db, TK_ID, zName);
zColname = zName;
zToFree = 0;
if( longNames || pTabList->nSrc>1 ){
Expr *pLeft;
pLeft = sqlite3Expr(db, TK_ID, zTabName);
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
if( zSchemaName ){
pLeft = sqlite3Expr(db, TK_ID, zSchemaName);
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
}
if( longNames ){
zColname = sqlite3MPrintf(db, "%s.%s", zTabName, zName);
zToFree = zColname;
}
}else{
pExpr = pRight;
}
pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
sqlite3TokenInit(&sColname, zColname);
sqlite3ExprListSetName(pParse, pNew, &sColname, 0);
if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){
struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
if( pSub ){
pX->zSpan = sqlite3DbStrDup(db, pSub->pEList->a[j].zSpan);
testcase( pX->zSpan==0 );
}else{
pX->zSpan = sqlite3MPrintf(db, "%s.%s.%s",
zSchemaName, zTabName, zColname);
testcase( pX->zSpan==0 );
}
pX->bSpanIsTab = 1;
}
sqlite3DbFree(db, zToFree);
}
}
if( !tableSeen ){
if( zTName ){
sqlite3ErrorMsg(pParse, "no such table: %s", zTName);
}else{
sqlite3ErrorMsg(pParse, "no tables specified");
}
}
}
}
sqlite3ExprListDelete(db, pEList);
p->pEList = pNew;
}
if( p->pEList ){
if( p->pEList->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){
sqlite3ErrorMsg(pParse, "too many columns in result set");
return WRC_Abort;
}
if( (elistFlags & (EP_HasFunc|EP_Subquery))!=0 ){
p->selFlags |= SF_ComplexResult;
}
}
return WRC_Continue;
} | 1612 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_for_atom | ast_for_atom( struct compiling * c , const node * n) | ['c', 'n'] | ast_for_atom(struct compiling *c, const node *n)
{
/* atom: '(' [yield_expr|testlist_comp] ')' | '[' [listmaker] ']'
| '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
*/
node *ch = CHILD(n, 0);
switch (TYPE(ch)) {
case NAME: {
/* All names start in Load context, but may later be
changed. */
PyObject *name = NEW_IDENTIFIER(ch);
if (!name)
return NULL;
return Name(name, Load, LINENO(n), n->n_col_offset, c->c_arena);
}
case STRING: {
PyObject *kind, *str = parsestrplus(c, n);
const char *raw, *s = STR(CHILD(n, 0));
int quote = Py_CHARMASK(*s);
/* currently Python allows up to 2 string modifiers */
char *ch, s_kind[3] = {0, 0, 0};
ch = s_kind;
raw = s;
while (*raw && *raw != '\'' && *raw != '"') {
*ch++ = *raw++;
}
kind = PyUnicode_FromString(s_kind);
if (!kind) {
return NULL;
}
if (!str) {
#ifdef Py_USING_UNICODE
if (PyErr_ExceptionMatches(PyExc_UnicodeError)){
PyObject *type, *value, *tback, *errstr;
PyErr_Fetch(&type, &value, &tback);
errstr = PyObject_Str(value);
if (errstr) {
char *s = "";
char buf[128];
s = _PyUnicode_AsString(errstr);
PyOS_snprintf(buf, sizeof(buf), "(unicode error) %s", s);
ast_error(n, buf);
Py_DECREF(errstr);
} else {
ast_error(n, "(unicode error) unknown error");
}
Py_DECREF(type);
Py_DECREF(value);
Py_XDECREF(tback);
}
#endif
return NULL;
}
PyArena_AddPyObject(c->c_arena, str);
return Str(str, kind, LINENO(n), n->n_col_offset, c->c_arena);
}
case NUMBER: {
PyObject *pynum = parsenumber(c, STR(ch));
if (!pynum)
return NULL;
PyArena_AddPyObject(c->c_arena, pynum);
return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena);
}
case LPAR: /* some parenthesized expressions */
ch = CHILD(n, 1);
if (TYPE(ch) == RPAR)
return Tuple(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
if (TYPE(ch) == yield_expr)
return ast_for_expr(c, ch);
return ast_for_testlist_comp(c, ch);
case LSQB: /* list (or list comprehension) */
ch = CHILD(n, 1);
if (TYPE(ch) == RSQB)
return List(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
REQ(ch, listmaker);
if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) {
asdl_seq *elts = seq_for_testlist(c, ch);
if (!elts)
return NULL;
return List(elts, Load, LINENO(n), n->n_col_offset, c->c_arena);
}
else
return ast_for_listcomp(c, ch);
case LBRACE: {
/* dictorsetmaker:
* (test ':' test (comp_for | (',' test ':' test)* [','])) |
* (test (comp_for | (',' test)* [',']))
*/
int i, size;
asdl_seq *keys, *values;
ch = CHILD(n, 1);
if (TYPE(ch) == RBRACE) {
/* it's an empty dict */
return Dict(NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena);
} else if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) {
/* it's a simple set */
asdl_seq *elts;
size = (NCH(ch) + 1) / 2; /* +1 in case no trailing comma */
elts = asdl_seq_new(size, c->c_arena);
if (!elts)
return NULL;
for (i = 0; i < NCH(ch); i += 2) {
expr_ty expression;
expression = ast_for_expr(c, CHILD(ch, i));
if (!expression)
return NULL;
asdl_seq_SET(elts, i / 2, expression);
}
return Set(elts, LINENO(n), n->n_col_offset, c->c_arena);
} else if (TYPE(CHILD(ch, 1)) == comp_for) {
/* it's a set comprehension */
return ast_for_setcomp(c, ch);
} else if (NCH(ch) > 3 && TYPE(CHILD(ch, 3)) == comp_for) {
return ast_for_dictcomp(c, ch);
} else {
/* it's a dict */
size = (NCH(ch) + 1) / 4; /* +1 in case no trailing comma */
keys = asdl_seq_new(size, c->c_arena);
if (!keys)
return NULL;
values = asdl_seq_new(size, c->c_arena);
if (!values)
return NULL;
for (i = 0; i < NCH(ch); i += 4) {
expr_ty expression;
expression = ast_for_expr(c, CHILD(ch, i));
if (!expression)
return NULL;
asdl_seq_SET(keys, i / 4, expression);
expression = ast_for_expr(c, CHILD(ch, i + 2));
if (!expression)
return NULL;
asdl_seq_SET(values, i / 4, expression);
}
return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena);
}
}
case BACKQUOTE: { /* repr */
expr_ty expression;
if (Py_Py3kWarningFlag &&
!ast_warn(c, n, "backquote not supported in 3.x; use repr()"))
return NULL;
expression = ast_for_testlist(c, CHILD(n, 1));
if (!expression)
return NULL;
return Repr(expression, LINENO(n), n->n_col_offset, c->c_arena);
}
default:
PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch));
return NULL;
}
} | 1087 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_for_atom | ast_for_atom( struct compiling * c , const node * n) | ['c', 'n'] | ast_for_atom(struct compiling *c, const node *n)
{
/* atom: '(' [yield_expr|testlist_comp] ')' | '[' [listmaker] ']'
| '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
*/
node *ch = CHILD(n, 0);
switch (TYPE(ch)) {
case NAME: {
/* All names start in Load context, but may later be
changed. */
PyObject *name = NEW_IDENTIFIER(ch);
if (!name)
return NULL;
return Name(name, Load, LINENO(n), n->n_col_offset, c->c_arena);
}
case STRING: {
PyObject *kind, *str = parsestrplus(c, n);
const char *raw, *s = STR(CHILD(n, 0));
int quote = Py_CHARMASK(*s);
/* currently Python allows up to 2 string modifiers */
char *ch, s_kind[3] = {0, 0, 0};
ch = s_kind;
raw = s;
while (*raw && *raw != '\'' && *raw != '"') {
*ch++ = *raw++;
}
kind = PyUnicode_FromString(s_kind);
if (!kind) {
return NULL;
}
if (!str) {
#ifdef Py_USING_UNICODE
if (PyErr_ExceptionMatches(PyExc_UnicodeError)){
PyObject *type, *value, *tback, *errstr;
PyErr_Fetch(&type, &value, &tback);
errstr = PyObject_Str(value);
if (errstr) {
char *s = "";
char buf[128];
s = _PyUnicode_AsString(errstr);
PyOS_snprintf(buf, sizeof(buf), "(unicode error) %s", s);
ast_error(n, buf);
Py_DECREF(errstr);
} else {
ast_error(n, "(unicode error) unknown error");
}
Py_DECREF(type);
Py_DECREF(value);
Py_XDECREF(tback);
}
#endif
return NULL;
}
PyArena_AddPyObject(c->c_arena, str);
return Str(str, kind, LINENO(n), n->n_col_offset, c->c_arena);
}
case NUMBER: {
PyObject *pynum = parsenumber(c, STR(ch));
if (!pynum)
return NULL;
PyArena_AddPyObject(c->c_arena, pynum);
return Num(pynum, LINENO(n), n->n_col_offset, c->c_arena);
}
case LPAR: /* some parenthesized expressions */
ch = CHILD(n, 1);
if (TYPE(ch) == RPAR)
return Tuple(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
if (TYPE(ch) == yield_expr)
return ast_for_expr(c, ch);
return ast_for_testlist_comp(c, ch);
case LSQB: /* list (or list comprehension) */
ch = CHILD(n, 1);
if (TYPE(ch) == RSQB)
return List(NULL, Load, LINENO(n), n->n_col_offset, c->c_arena);
REQ(ch, listmaker);
if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) {
asdl_seq *elts = seq_for_testlist(c, ch);
if (!elts)
return NULL;
return List(elts, Load, LINENO(n), n->n_col_offset, c->c_arena);
}
else
return ast_for_listcomp(c, ch);
case LBRACE: {
/* dictorsetmaker:
* (test ':' test (comp_for | (',' test ':' test)* [','])) |
* (test (comp_for | (',' test)* [',']))
*/
int i, size;
asdl_seq *keys, *values;
ch = CHILD(n, 1);
if (TYPE(ch) == RBRACE) {
/* it's an empty dict */
return Dict(NULL, NULL, LINENO(n), n->n_col_offset, c->c_arena);
} else if (NCH(ch) == 1 || TYPE(CHILD(ch, 1)) == COMMA) {
/* it's a simple set */
asdl_seq *elts;
size = (NCH(ch) + 1) / 2; /* +1 in case no trailing comma */
elts = asdl_seq_new(size, c->c_arena);
if (!elts)
return NULL;
for (i = 0; i < NCH(ch); i += 2) {
expr_ty expression;
expression = ast_for_expr(c, CHILD(ch, i));
if (!expression)
return NULL;
asdl_seq_SET(elts, i / 2, expression);
}
return Set(elts, LINENO(n), n->n_col_offset, c->c_arena);
} else if (TYPE(CHILD(ch, 1)) == comp_for) {
/* it's a set comprehension */
return ast_for_setcomp(c, ch);
} else if (NCH(ch) > 3 && TYPE(CHILD(ch, 3)) == comp_for) {
return ast_for_dictcomp(c, ch);
} else {
/* it's a dict */
size = (NCH(ch) + 1) / 4; /* +1 in case no trailing comma */
keys = asdl_seq_new(size, c->c_arena);
if (!keys)
return NULL;
values = asdl_seq_new(size, c->c_arena);
if (!values)
return NULL;
for (i = 0; i < NCH(ch); i += 4) {
expr_ty expression;
expression = ast_for_expr(c, CHILD(ch, i));
if (!expression)
return NULL;
asdl_seq_SET(keys, i / 4, expression);
expression = ast_for_expr(c, CHILD(ch, i + 2));
if (!expression)
return NULL;
asdl_seq_SET(values, i / 4, expression);
}
return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena);
}
}
case BACKQUOTE: { /* repr */
expr_ty expression;
if (Py_Py3kWarningFlag &&
!ast_warn(c, n, "backquote not supported in 3.x; use repr()"))
return NULL;
expression = ast_for_testlist(c, CHILD(n, 1));
if (!expression)
return NULL;
return Repr(expression, LINENO(n), n->n_col_offset, c->c_arena);
}
default:
PyErr_Format(PyExc_SystemError, "unhandled atom %d", TYPE(ch));
return NULL;
}
} | 1087 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_for_call | ast_for_call( struct compiling * c , const node * n , expr_ty func) | ['c', 'n', 'func'] | ast_for_call(struct compiling *c, const node *n, expr_ty func)
{
/*
arglist: (argument ',')* (argument [',']| '*' test [',' '**' test]
| '**' test)
argument: [test '='] test [comp_for] # Really [keyword '='] test
*/
int i, nargs, nkeywords, ngens;
asdl_seq *args;
asdl_seq *keywords;
expr_ty vararg = NULL, kwarg = NULL;
REQ(n, arglist);
nargs = 0;
nkeywords = 0;
ngens = 0;
for (i = 0; i < NCH(n); i++) {
node *ch = CHILD(n, i);
if (TYPE(ch) == argument) {
if (NCH(ch) == 1)
nargs++;
else if (TYPE(CHILD(ch, 1)) == comp_for)
ngens++;
else
nkeywords++;
}
}
if (ngens > 1 || (ngens && (nargs || nkeywords))) {
ast_error(n, "Generator expression must be parenthesized "
"if not sole argument");
return NULL;
}
if (nargs + nkeywords + ngens > 255) {
ast_error(n, "more than 255 arguments");
return NULL;
}
args = asdl_seq_new(nargs + ngens, c->c_arena);
if (!args)
return NULL;
keywords = asdl_seq_new(nkeywords, c->c_arena);
if (!keywords)
return NULL;
nargs = 0;
nkeywords = 0;
for (i = 0; i < NCH(n); i++) {
node *ch = CHILD(n, i);
if (TYPE(ch) == argument) {
expr_ty e;
if (NCH(ch) == 1) {
if (nkeywords) {
ast_error(CHILD(ch, 0),
"non-keyword arg after keyword arg");
return NULL;
}
if (vararg) {
ast_error(CHILD(ch, 0),
"only named arguments may follow *expression");
return NULL;
}
e = ast_for_expr(c, CHILD(ch, 0));
if (!e)
return NULL;
asdl_seq_SET(args, nargs++, e);
}
else if (TYPE(CHILD(ch, 1)) == comp_for) {
e = ast_for_genexp(c, ch);
if (!e)
return NULL;
asdl_seq_SET(args, nargs++, e);
}
else {
keyword_ty kw;
identifier key;
int k;
char *tmp;
/* CHILD(ch, 0) is test, but must be an identifier? */
e = ast_for_expr(c, CHILD(ch, 0));
if (!e)
return NULL;
/* f(lambda x: x[0] = 3) ends up getting parsed with
* LHS test = lambda x: x[0], and RHS test = 3.
* SF bug 132313 points out that complaining about a keyword
* then is very confusing.
*/
if (e->kind == Lambda_kind) {
ast_error(CHILD(ch, 0),
"lambda cannot contain assignment");
return NULL;
} else if (e->kind != Name_kind) {
ast_error(CHILD(ch, 0), "keyword can't be an expression");
return NULL;
}
key = e->v.Name.id;
if (!forbidden_check(c, CHILD(ch, 0), PyUnicode_AsUTF8(key)))
return NULL;
for (k = 0; k < nkeywords; k++) {
tmp = _PyUnicode_AsString(
((keyword_ty)asdl_seq_GET(keywords, k))->arg);
if (!strcmp(tmp, _PyUnicode_AsString(key))) {
ast_error(CHILD(ch, 0), "keyword argument repeated");
return NULL;
}
}
e = ast_for_expr(c, CHILD(ch, 2));
if (!e)
return NULL;
kw = keyword(key, e, c->c_arena);
if (!kw)
return NULL;
asdl_seq_SET(keywords, nkeywords++, kw);
}
}
else if (TYPE(ch) == STAR) {
vararg = ast_for_expr(c, CHILD(n, i+1));
if (!vararg)
return NULL;
i++;
}
else if (TYPE(ch) == DOUBLESTAR) {
kwarg = ast_for_expr(c, CHILD(n, i+1));
if (!kwarg)
return NULL;
i++;
}
}
return Call(func, args, keywords, vararg, kwarg, func->lineno,
func->col_offset, c->c_arena);
} | 750 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_for_call | ast_for_call( struct compiling * c , const node * n , expr_ty func) | ['c', 'n', 'func'] | ast_for_call(struct compiling *c, const node *n, expr_ty func)
{
/*
arglist: (argument ',')* (argument [',']| '*' test [',' '**' test]
| '**' test)
argument: [test '='] test [comp_for] # Really [keyword '='] test
*/
int i, nargs, nkeywords, ngens;
asdl_seq *args;
asdl_seq *keywords;
expr_ty vararg = NULL, kwarg = NULL;
REQ(n, arglist);
nargs = 0;
nkeywords = 0;
ngens = 0;
for (i = 0; i < NCH(n); i++) {
node *ch = CHILD(n, i);
if (TYPE(ch) == argument) {
if (NCH(ch) == 1)
nargs++;
else if (TYPE(CHILD(ch, 1)) == comp_for)
ngens++;
else
nkeywords++;
}
}
if (ngens > 1 || (ngens && (nargs || nkeywords))) {
ast_error(n, "Generator expression must be parenthesized "
"if not sole argument");
return NULL;
}
if (nargs + nkeywords + ngens > 255) {
ast_error(n, "more than 255 arguments");
return NULL;
}
args = asdl_seq_new(nargs + ngens, c->c_arena);
if (!args)
return NULL;
keywords = asdl_seq_new(nkeywords, c->c_arena);
if (!keywords)
return NULL;
nargs = 0;
nkeywords = 0;
for (i = 0; i < NCH(n); i++) {
node *ch = CHILD(n, i);
if (TYPE(ch) == argument) {
expr_ty e;
if (NCH(ch) == 1) {
if (nkeywords) {
ast_error(CHILD(ch, 0),
"non-keyword arg after keyword arg");
return NULL;
}
if (vararg) {
ast_error(CHILD(ch, 0),
"only named arguments may follow *expression");
return NULL;
}
e = ast_for_expr(c, CHILD(ch, 0));
if (!e)
return NULL;
asdl_seq_SET(args, nargs++, e);
}
else if (TYPE(CHILD(ch, 1)) == comp_for) {
e = ast_for_genexp(c, ch);
if (!e)
return NULL;
asdl_seq_SET(args, nargs++, e);
}
else {
keyword_ty kw;
identifier key;
int k;
char *tmp;
/* CHILD(ch, 0) is test, but must be an identifier? */
e = ast_for_expr(c, CHILD(ch, 0));
if (!e)
return NULL;
/* f(lambda x: x[0] = 3) ends up getting parsed with
* LHS test = lambda x: x[0], and RHS test = 3.
* SF bug 132313 points out that complaining about a keyword
* then is very confusing.
*/
if (e->kind == Lambda_kind) {
ast_error(CHILD(ch, 0),
"lambda cannot contain assignment");
return NULL;
} else if (e->kind != Name_kind) {
ast_error(CHILD(ch, 0), "keyword can't be an expression");
return NULL;
}
key = e->v.Name.id;
if (!forbidden_check(c, CHILD(ch, 0), PyUnicode_AsUTF8(key)))
return NULL;
for (k = 0; k < nkeywords; k++) {
tmp = _PyUnicode_AsString(
((keyword_ty)asdl_seq_GET(keywords, k))->arg);
if (!strcmp(tmp, _PyUnicode_AsString(key))) {
ast_error(CHILD(ch, 0), "keyword argument repeated");
return NULL;
}
}
e = ast_for_expr(c, CHILD(ch, 2));
if (!e)
return NULL;
kw = keyword(key, e, c->c_arena);
if (!kw)
return NULL;
asdl_seq_SET(keywords, nkeywords++, kw);
}
}
else if (TYPE(ch) == STAR) {
vararg = ast_for_expr(c, CHILD(n, i+1));
if (!vararg)
return NULL;
i++;
}
else if (TYPE(ch) == DOUBLESTAR) {
kwarg = ast_for_expr(c, CHILD(n, i+1));
if (!kwarg)
return NULL;
i++;
}
}
return Call(func, args, keywords, vararg, kwarg, func->lineno,
func->col_offset, c->c_arena);
} | 750 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | string_object_to_c_ast | string_object_to_c_ast( const char * s , PyObject * filename , int start , PyCompilerFlags * flags , int feature_version , PyArena * arena) | ['s', 'filename', 'start', 'flags', 'feature_version', 'arena'] | string_object_to_c_ast(const char *s, PyObject *filename, int start,
PyCompilerFlags *flags, int feature_version,
PyArena *arena)
{
mod_ty mod;
PyCompilerFlags localflags;
perrdetail err;
int iflags = PARSER_FLAGS(flags);
node *n = Ta3Parser_ParseStringObject(s, filename,
&_Ta3Parser_Grammar, start, &err,
&iflags);
if (flags == NULL) {
localflags.cf_flags = 0;
flags = &localflags;
}
if (n) {
flags->cf_flags |= iflags & PyCF_MASK;
mod = Ta3AST_FromNodeObject(n, flags, filename, feature_version, arena);
Ta3Node_Free(n);
}
else {
err_input(&err);
mod = NULL;
}
err_free(&err);
return mod;
} | 141 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | string_object_to_c_ast | string_object_to_c_ast( const char * s , PyObject * filename , int start , PyCompilerFlags * flags , int feature_version , PyArena * arena) | ['s', 'filename', 'start', 'flags', 'feature_version', 'arena'] | string_object_to_c_ast(const char *s, PyObject *filename, int start,
PyCompilerFlags *flags, int feature_version,
PyArena *arena)
{
mod_ty mod;
PyCompilerFlags localflags;
perrdetail err;
int iflags = PARSER_FLAGS(flags);
node *n = Ta3Parser_ParseStringObject(s, filename,
&_Ta3Parser_Grammar, start, &err,
&iflags);
if (flags == NULL) {
localflags.cf_flags = 0;
flags = &localflags;
}
if (n) {
flags->cf_flags |= iflags & PyCF_MASK;
mod = Ta3AST_FromNodeObject(n, flags, filename, feature_version, arena);
Ta3Node_Free(n);
}
else {
err_input(&err);
mod = NULL;
}
err_free(&err);
return mod;
} | 141 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3Grammar_FindDFA | Ta3Grammar_FindDFA( grammar * g , int type) | ['g', 'type'] | Ta3Grammar_FindDFA(grammar *g, int type)
{
dfa *d;
#if 1
/* Massive speed-up */
d = &g->g_dfa[type - NT_OFFSET];
assert(d->d_type == type);
return d;
#else
/* Old, slow version */
int i;
for (i = g->g_ndfas, d = g->g_dfa; --i >= 0; d++) {
if (d->d_type == type)
return d;
}
assert(0);
/* NOTREACHED */
#endif
} | 82 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3Grammar_FindDFA | Ta3Grammar_FindDFA( grammar * g , int type) | ['g', 'type'] | Ta3Grammar_FindDFA(grammar *g, int type)
{
dfa *d;
#if 1
/* Massive speed-up */
d = &g->g_dfa[type - NT_OFFSET];
assert(d->d_type == type);
return d;
#else
/* Old, slow version */
int i;
for (i = g->g_ndfas, d = g->g_dfa; --i >= 0; d++) {
if (d->d_type == type)
return d;
}
assert(0);
/* NOTREACHED */
#endif
} | 82 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | parsetok | parsetok( struct tok_state * tok , grammar * g , int start , perrdetail * err_ret , int * flags) | ['tok', 'g', 'start', 'err_ret', 'flags'] | parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
int *flags)
{
parser_state *ps;
node *n;
int started = 0;
growable_int_array type_ignores;
if (!growable_int_array_init(&type_ignores, 10)) {
err_ret->error = E_NOMEM;
Ta3Tokenizer_Free(tok);
return NULL;
}
if ((ps = Ta3Parser_New(g, start)) == NULL) {
err_ret->error = E_NOMEM;
Ta3Tokenizer_Free(tok);
return NULL;
}
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
if (*flags & PyPARSE_BARRY_AS_BDFL)
ps->p_flags |= CO_FUTURE_BARRY_AS_BDFL;
#endif
for (;;) {
char *a, *b;
int type;
size_t len;
char *str;
int col_offset;
type = Ta3Tokenizer_Get(tok, &a, &b);
if (type == ERRORTOKEN) {
err_ret->error = tok->done;
break;
}
if (type == ENDMARKER && started) {
type = NEWLINE; /* Add an extra newline */
started = 0;
/* Add the right number of dedent tokens,
except if a certain flag is given --
codeop.py uses this. */
if (tok->indent &&
!(*flags & PyPARSE_DONT_IMPLY_DEDENT))
{
tok->pendin = -tok->indent;
tok->indent = 0;
}
}
else
started = 1;
len = b - a; /* XXX this may compute NULL - NULL */
str = (char *) PyObject_MALLOC(len + 1);
if (str == NULL) {
err_ret->error = E_NOMEM;
break;
}
if (len > 0)
strncpy(str, a, len);
str[len] = '\0';
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
if (type == NOTEQUAL) {
if (!(ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "!=")) {
PyObject_FREE(str);
err_ret->error = E_SYNTAX;
break;
}
else if ((ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "<>")) {
PyObject_FREE(str);
err_ret->text = "with Barry as BDFL, use '<>' "
"instead of '!='";
err_ret->error = E_SYNTAX;
break;
}
}
#endif
if (a >= tok->line_start)
col_offset = Py_SAFE_DOWNCAST(a - tok->line_start,
intptr_t, int);
else
col_offset = -1;
if (type == TYPE_IGNORE) {
if (!growable_int_array_add(&type_ignores, tok->lineno)) {
err_ret->error = E_NOMEM;
break;
}
continue;
}
if ((err_ret->error =
Ta3Parser_AddToken(ps, (int)type, str,
tok->lineno, col_offset,
&(err_ret->expected))) != E_OK) {
if (err_ret->error != E_DONE) {
PyObject_FREE(str);
err_ret->token = type;
}
break;
}
}
if (err_ret->error == E_DONE) {
n = ps->p_tree;
ps->p_tree = NULL;
if (n->n_type == file_input) {
/* Put type_ignore nodes in the ENDMARKER of file_input. */
int num;
node *ch;
size_t i;
num = NCH(n);
ch = CHILD(n, num - 1);
REQ(ch, ENDMARKER);
for (i = 0; i < type_ignores.num_items; i++) {
Ta3Node_AddChild(ch, TYPE_IGNORE, NULL, type_ignores.items[i], 0);
}
}
growable_int_array_deallocate(&type_ignores);
#ifndef PGEN
/* Check that the source for a single input statement really
is a single statement by looking at what is left in the
buffer after parsing. Trailing whitespace and comments
are OK. */
if (start == single_input) {
char *cur = tok->cur;
char c = *tok->cur;
for (;;) {
while (c == ' ' || c == '\t' || c == '\n' || c == '\014')
c = *++cur;
if (!c)
break;
if (c != '#') {
err_ret->error = E_BADSINGLE;
Ta3Node_Free(n);
n = NULL;
break;
}
/* Suck up comment. */
while (c && c != '\n')
c = *++cur;
}
}
#endif
}
else
n = NULL;
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
*flags = ps->p_flags;
#endif
Ta3Parser_Delete(ps);
if (n == NULL) {
if (tok->done == E_EOF)
err_ret->error = E_EOF;
err_ret->lineno = tok->lineno;
if (tok->buf != NULL) {
size_t len;
assert(tok->cur - tok->buf < INT_MAX);
err_ret->offset = (int)(tok->cur - tok->buf);
len = tok->inp - tok->buf;
err_ret->text = (char *) PyObject_MALLOC(len + 1);
if (err_ret->text != NULL) {
if (len > 0)
strncpy(err_ret->text, tok->buf, len);
err_ret->text[len] = '\0';
}
}
} else if (tok->encoding != NULL) {
/* 'nodes->n_str' uses PyObject_*, while 'tok->encoding' was
* allocated using PyMem_
*/
node* r = Ta3Node_New(encoding_decl);
if (r)
r->n_str = PyObject_MALLOC(strlen(tok->encoding)+1);
if (!r || !r->n_str) {
err_ret->error = E_NOMEM;
if (r)
PyObject_FREE(r);
n = NULL;
goto done;
}
strcpy(r->n_str, tok->encoding);
PyMem_FREE(tok->encoding);
tok->encoding = NULL;
r->n_nchildren = 1;
r->n_child = n;
n = r;
}
done:
Ta3Tokenizer_Free(tok);
return n;
} | 969 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | parsetok | parsetok( struct tok_state * tok , grammar * g , int start , perrdetail * err_ret , int * flags) | ['tok', 'g', 'start', 'err_ret', 'flags'] | parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
int *flags)
{
parser_state *ps;
node *n;
int started = 0;
growable_int_array type_ignores;
if (!growable_int_array_init(&type_ignores, 10)) {
err_ret->error = E_NOMEM;
Ta3Tokenizer_Free(tok);
return NULL;
}
if ((ps = Ta3Parser_New(g, start)) == NULL) {
err_ret->error = E_NOMEM;
Ta3Tokenizer_Free(tok);
return NULL;
}
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
if (*flags & PyPARSE_BARRY_AS_BDFL)
ps->p_flags |= CO_FUTURE_BARRY_AS_BDFL;
#endif
for (;;) {
char *a, *b;
int type;
size_t len;
char *str;
int col_offset;
type = Ta3Tokenizer_Get(tok, &a, &b);
if (type == ERRORTOKEN) {
err_ret->error = tok->done;
break;
}
if (type == ENDMARKER && started) {
type = NEWLINE; /* Add an extra newline */
started = 0;
/* Add the right number of dedent tokens,
except if a certain flag is given --
codeop.py uses this. */
if (tok->indent &&
!(*flags & PyPARSE_DONT_IMPLY_DEDENT))
{
tok->pendin = -tok->indent;
tok->indent = 0;
}
}
else
started = 1;
len = b - a; /* XXX this may compute NULL - NULL */
str = (char *) PyObject_MALLOC(len + 1);
if (str == NULL) {
err_ret->error = E_NOMEM;
break;
}
if (len > 0)
strncpy(str, a, len);
str[len] = '\0';
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
if (type == NOTEQUAL) {
if (!(ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "!=")) {
PyObject_FREE(str);
err_ret->error = E_SYNTAX;
break;
}
else if ((ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "<>")) {
PyObject_FREE(str);
err_ret->text = "with Barry as BDFL, use '<>' "
"instead of '!='";
err_ret->error = E_SYNTAX;
break;
}
}
#endif
if (a >= tok->line_start)
col_offset = Py_SAFE_DOWNCAST(a - tok->line_start,
intptr_t, int);
else
col_offset = -1;
if (type == TYPE_IGNORE) {
if (!growable_int_array_add(&type_ignores, tok->lineno)) {
err_ret->error = E_NOMEM;
break;
}
continue;
}
if ((err_ret->error =
Ta3Parser_AddToken(ps, (int)type, str,
tok->lineno, col_offset,
&(err_ret->expected))) != E_OK) {
if (err_ret->error != E_DONE) {
PyObject_FREE(str);
err_ret->token = type;
}
break;
}
}
if (err_ret->error == E_DONE) {
n = ps->p_tree;
ps->p_tree = NULL;
if (n->n_type == file_input) {
/* Put type_ignore nodes in the ENDMARKER of file_input. */
int num;
node *ch;
size_t i;
num = NCH(n);
ch = CHILD(n, num - 1);
REQ(ch, ENDMARKER);
for (i = 0; i < type_ignores.num_items; i++) {
Ta3Node_AddChild(ch, TYPE_IGNORE, NULL, type_ignores.items[i], 0);
}
}
growable_int_array_deallocate(&type_ignores);
#ifndef PGEN
/* Check that the source for a single input statement really
is a single statement by looking at what is left in the
buffer after parsing. Trailing whitespace and comments
are OK. */
if (start == single_input) {
char *cur = tok->cur;
char c = *tok->cur;
for (;;) {
while (c == ' ' || c == '\t' || c == '\n' || c == '\014')
c = *++cur;
if (!c)
break;
if (c != '#') {
err_ret->error = E_BADSINGLE;
Ta3Node_Free(n);
n = NULL;
break;
}
/* Suck up comment. */
while (c && c != '\n')
c = *++cur;
}
}
#endif
}
else
n = NULL;
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
*flags = ps->p_flags;
#endif
Ta3Parser_Delete(ps);
if (n == NULL) {
if (tok->done == E_EOF)
err_ret->error = E_EOF;
err_ret->lineno = tok->lineno;
if (tok->buf != NULL) {
size_t len;
assert(tok->cur - tok->buf < INT_MAX);
err_ret->offset = (int)(tok->cur - tok->buf);
len = tok->inp - tok->buf;
err_ret->text = (char *) PyObject_MALLOC(len + 1);
if (err_ret->text != NULL) {
if (len > 0)
strncpy(err_ret->text, tok->buf, len);
err_ret->text[len] = '\0';
}
}
} else if (tok->encoding != NULL) {
/* 'nodes->n_str' uses PyObject_*, while 'tok->encoding' was
* allocated using PyMem_
*/
node* r = Ta3Node_New(encoding_decl);
if (r)
r->n_str = PyObject_MALLOC(strlen(tok->encoding)+1);
if (!r || !r->n_str) {
err_ret->error = E_NOMEM;
if (r)
PyObject_FREE(r);
n = NULL;
goto done;
}
strcpy(r->n_str, tok->encoding);
PyMem_FREE(tok->encoding);
tok->encoding = NULL;
r->n_nchildren = 1;
r->n_child = n;
n = r;
}
done:
Ta3Tokenizer_Free(tok);
return n;
} | 969 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3Tokenizer_FindEncodingFilename | Ta3Tokenizer_FindEncodingFilename( int fd , PyObject * filename) | ['fd', 'filename'] | Ta3Tokenizer_FindEncodingFilename(int fd, PyObject *filename)
{
struct tok_state *tok;
FILE *fp;
char *p_start =NULL , *p_end =NULL , *encoding = NULL;
#ifndef PGEN
#if PY_MINOR_VERSION >= 4
fd = _Py_dup(fd);
#endif
#else
fd = dup(fd);
#endif
if (fd < 0) {
return NULL;
}
fp = fdopen(fd, "r");
if (fp == NULL) {
return NULL;
}
tok = Ta3Tokenizer_FromFile(fp, NULL, NULL, NULL);
if (tok == NULL) {
fclose(fp);
return NULL;
}
#ifndef PGEN
if (filename != NULL) {
Py_INCREF(filename);
tok->filename = filename;
}
else {
tok->filename = PyUnicode_FromString("<string>");
if (tok->filename == NULL) {
fclose(fp);
Ta3Tokenizer_Free(tok);
return encoding;
}
}
#endif
while (tok->lineno < 2 && tok->done == E_OK) {
Ta3Tokenizer_Get(tok, &p_start, &p_end);
}
fclose(fp);
if (tok->encoding) {
encoding = (char *)PyMem_MALLOC(strlen(tok->encoding) + 1);
if (encoding)
strcpy(encoding, tok->encoding);
}
Ta3Tokenizer_Free(tok);
return encoding;
} | 243 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3Tokenizer_FindEncodingFilename | Ta3Tokenizer_FindEncodingFilename( int fd , PyObject * filename) | ['fd', 'filename'] | Ta3Tokenizer_FindEncodingFilename(int fd, PyObject *filename)
{
struct tok_state *tok;
FILE *fp;
char *p_start =NULL , *p_end =NULL , *encoding = NULL;
#ifndef PGEN
#if PY_MINOR_VERSION >= 4
fd = _Py_dup(fd);
#endif
#else
fd = dup(fd);
#endif
if (fd < 0) {
return NULL;
}
fp = fdopen(fd, "r");
if (fp == NULL) {
return NULL;
}
tok = Ta3Tokenizer_FromFile(fp, NULL, NULL, NULL);
if (tok == NULL) {
fclose(fp);
return NULL;
}
#ifndef PGEN
if (filename != NULL) {
Py_INCREF(filename);
tok->filename = filename;
}
else {
tok->filename = PyUnicode_FromString("<string>");
if (tok->filename == NULL) {
fclose(fp);
Ta3Tokenizer_Free(tok);
return encoding;
}
}
#endif
while (tok->lineno < 2 && tok->done == E_OK) {
Ta3Tokenizer_Get(tok, &p_start, &p_end);
}
fclose(fp);
if (tok->encoding) {
encoding = (char *)PyMem_MALLOC(strlen(tok->encoding) + 1);
if (encoding)
strcpy(encoding, tok->encoding);
}
Ta3Tokenizer_Free(tok);
return encoding;
} | 243 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | decoding_feof | decoding_feof( struct tok_state * tok) | ['tok'] | decoding_feof(struct tok_state *tok)
{
if (tok->decoding_state != STATE_NORMAL) {
return feof(tok->fp);
} else {
PyObject* buf = tok->decoding_buffer;
if (buf == NULL) {
buf = PyObject_CallObject(tok->decoding_readline, NULL);
if (buf == NULL) {
error_ret(tok);
return 1;
} else {
tok->decoding_buffer = buf;
}
}
return PyObject_Length(buf) == 0;
}
} | 90 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | decoding_feof | decoding_feof( struct tok_state * tok) | ['tok'] | decoding_feof(struct tok_state *tok)
{
if (tok->decoding_state != STATE_NORMAL) {
return feof(tok->fp);
} else {
PyObject* buf = tok->decoding_buffer;
if (buf == NULL) {
buf = PyObject_CallObject(tok->decoding_readline, NULL);
if (buf == NULL) {
error_ret(tok);
return 1;
} else {
tok->decoding_buffer = buf;
}
}
return PyObject_Length(buf) == 0;
}
} | 90 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | fp_readl | fp_readl( char * s , int size , struct tok_state * tok) | ['s', 'size', 'tok'] | fp_readl(char *s, int size, struct tok_state *tok)
{
PyObject* bufobj;
const char *buf;
Py_ssize_t buflen;
/* Ask for one less byte so we can terminate it */
assert(size > 0);
size--;
if (tok->decoding_buffer) {
bufobj = tok->decoding_buffer;
Py_INCREF(bufobj);
}
else
{
bufobj = PyObject_CallObject(tok->decoding_readline, NULL);
if (bufobj == NULL)
goto error;
}
if (PyUnicode_CheckExact(bufobj))
{
buf = PyUnicode_AsUTF8AndSize(bufobj, &buflen);
if (buf == NULL) {
goto error;
}
}
else
{
buf = PyByteArray_AsString(bufobj);
if (buf == NULL) {
goto error;
}
buflen = PyByteArray_GET_SIZE(bufobj);
}
Py_XDECREF(tok->decoding_buffer);
if (buflen > size) {
/* Too many chars, the rest goes into tok->decoding_buffer */
tok->decoding_buffer = PyByteArray_FromStringAndSize(buf+size,
buflen-size);
if (tok->decoding_buffer == NULL)
goto error;
buflen = size;
}
else
tok->decoding_buffer = NULL;
memcpy(s, buf, buflen);
s[buflen] = '\0';
if (buflen == 0) /* EOF */
s = NULL;
Py_DECREF(bufobj);
return s;
error:
Py_XDECREF(bufobj);
return error_ret(tok);
} | 237 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | fp_readl | fp_readl( char * s , int size , struct tok_state * tok) | ['s', 'size', 'tok'] | fp_readl(char *s, int size, struct tok_state *tok)
{
PyObject* bufobj;
const char *buf;
Py_ssize_t buflen;
/* Ask for one less byte so we can terminate it */
assert(size > 0);
size--;
if (tok->decoding_buffer) {
bufobj = tok->decoding_buffer;
Py_INCREF(bufobj);
}
else
{
bufobj = PyObject_CallObject(tok->decoding_readline, NULL);
if (bufobj == NULL)
goto error;
}
if (PyUnicode_CheckExact(bufobj))
{
buf = PyUnicode_AsUTF8AndSize(bufobj, &buflen);
if (buf == NULL) {
goto error;
}
}
else
{
buf = PyByteArray_AsString(bufobj);
if (buf == NULL) {
goto error;
}
buflen = PyByteArray_GET_SIZE(bufobj);
}
Py_XDECREF(tok->decoding_buffer);
if (buflen > size) {
/* Too many chars, the rest goes into tok->decoding_buffer */
tok->decoding_buffer = PyByteArray_FromStringAndSize(buf+size,
buflen-size);
if (tok->decoding_buffer == NULL)
goto error;
buflen = size;
}
else
tok->decoding_buffer = NULL;
memcpy(s, buf, buflen);
s[buflen] = '\0';
if (buflen == 0) /* EOF */
s = NULL;
Py_DECREF(bufobj);
return s;
error:
Py_XDECREF(bufobj);
return error_ret(tok);
} | 237 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | fp_setreadl | fp_setreadl( struct tok_state * tok , const char * enc) | ['tok', 'enc'] | fp_setreadl(struct tok_state *tok, const char* enc)
{
PyObject *readline, *io, *stream;
_Py_IDENTIFIER(open);
_Py_IDENTIFIER(readline);
int fd;
long pos;
fd = fileno(tok->fp);
/* Due to buffering the file offset for fd can be different from the file
* position of tok->fp. If tok->fp was opened in text mode on Windows,
* its file position counts CRLF as one char and can't be directly mapped
* to the file offset for fd. Instead we step back one byte and read to
* the end of line.*/
pos = ftell(tok->fp);
if (pos == -1 ||
lseek(fd, (off_t)(pos > 0 ? pos - 1 : pos), SEEK_SET) == (off_t)-1) {
PyErr_SetFromErrnoWithFilename(PyExc_OSError, NULL);
return 0;
}
io = PyImport_ImportModuleNoBlock("io");
if (io == NULL)
return 0;
stream = _PyObject_CallMethodId(io, &PyId_open, "isisOOO",
fd, "r", -1, enc, Py_None, Py_None, Py_False);
Py_DECREF(io);
if (stream == NULL)
return 0;
readline = _PyObject_GetAttrId(stream, &PyId_readline);
Py_DECREF(stream);
if (readline == NULL)
return 0;
Py_XSETREF(tok->decoding_readline, readline);
if (pos > 0) {
PyObject *bufobj = PyObject_CallObject(readline, NULL);
if (bufobj == NULL)
return 0;
Py_DECREF(bufobj);
}
return 1;
} | 231 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | fp_setreadl | fp_setreadl( struct tok_state * tok , const char * enc) | ['tok', 'enc'] | fp_setreadl(struct tok_state *tok, const char* enc)
{
PyObject *readline, *io, *stream;
_Py_IDENTIFIER(open);
_Py_IDENTIFIER(readline);
int fd;
long pos;
fd = fileno(tok->fp);
/* Due to buffering the file offset for fd can be different from the file
* position of tok->fp. If tok->fp was opened in text mode on Windows,
* its file position counts CRLF as one char and can't be directly mapped
* to the file offset for fd. Instead we step back one byte and read to
* the end of line.*/
pos = ftell(tok->fp);
if (pos == -1 ||
lseek(fd, (off_t)(pos > 0 ? pos - 1 : pos), SEEK_SET) == (off_t)-1) {
PyErr_SetFromErrnoWithFilename(PyExc_OSError, NULL);
return 0;
}
io = PyImport_ImportModuleNoBlock("io");
if (io == NULL)
return 0;
stream = _PyObject_CallMethodId(io, &PyId_open, "isisOOO",
fd, "r", -1, enc, Py_None, Py_None, Py_False);
Py_DECREF(io);
if (stream == NULL)
return 0;
readline = _PyObject_GetAttrId(stream, &PyId_readline);
Py_DECREF(stream);
if (readline == NULL)
return 0;
Py_XSETREF(tok->decoding_readline, readline);
if (pos > 0) {
PyObject *bufobj = PyObject_CallObject(readline, NULL);
if (bufobj == NULL)
return 0;
Py_DECREF(bufobj);
}
return 1;
} | 231 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | indenterror | indenterror( struct tok_state * tok) | ['tok'] | indenterror(struct tok_state *tok)
{
if (tok->alterror) {
tok->done = E_TABSPACE;
tok->cur = tok->inp;
return 1;
}
if (tok->altwarning) {
#ifdef PGEN
PySys_WriteStderr("inconsistent use of tabs and spaces "
"in indentation\n");
#else
PySys_FormatStderr("%U: inconsistent use of tabs and spaces "
"in indentation\n", tok->filename);
#endif
tok->altwarning = 0;
}
return 0;
} | 67 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | indenterror | indenterror( struct tok_state * tok) | ['tok'] | indenterror(struct tok_state *tok)
{
if (tok->alterror) {
tok->done = E_TABSPACE;
tok->cur = tok->inp;
return 1;
}
if (tok->altwarning) {
#ifdef PGEN
PySys_WriteStderr("inconsistent use of tabs and spaces "
"in indentation\n");
#else
PySys_FormatStderr("%U: inconsistent use of tabs and spaces "
"in indentation\n", tok->filename);
#endif
tok->altwarning = 0;
}
return 0;
} | 67 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | tok_get | tok_get( struct tok_state * tok , char ** p_start , char ** p_end) | ['tok', 'p_start', 'p_end'] | tok_get(struct tok_state *tok, char **p_start, char **p_end)
{
int c;
int blankline, nonascii;
*p_start = *p_end = NULL;
nextline:
tok->start = NULL;
blankline = 0;
/* Get indentation level */
if (tok->atbol) {
int col = 0;
int altcol = 0;
tok->atbol = 0;
for (;;) {
c = tok_nextc(tok);
if (c == ' ') {
col++, altcol++;
}
else if (c == '\t') {
col = (col/tok->tabsize + 1) * tok->tabsize;
altcol = (altcol/tok->alttabsize + 1)
* tok->alttabsize;
}
else if (c == '\014') {/* Control-L (formfeed) */
col = altcol = 0; /* For Emacs users */
}
else {
break;
}
}
tok_backup(tok, c);
if (c == '#' || c == '\n') {
/* Lines with only whitespace and/or comments
shouldn't affect the indentation and are
not passed to the parser as NEWLINE tokens,
except *totally* empty lines in interactive
mode, which signal the end of a command group. */
if (col == 0 && c == '\n' && tok->prompt != NULL) {
blankline = 0; /* Let it through */
}
else {
blankline = 1; /* Ignore completely */
}
/* We can't jump back right here since we still
may need to skip to the end of a comment */
}
if (!blankline && tok->level == 0) {
if (col == tok->indstack[tok->indent]) {
/* No change */
if (altcol != tok->altindstack[tok->indent]) {
if (indenterror(tok)) {
return ERRORTOKEN;
}
}
}
else if (col > tok->indstack[tok->indent]) {
/* Indent -- always one */
if (tok->indent+1 >= MAXINDENT) {
tok->done = E_TOODEEP;
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (altcol <= tok->altindstack[tok->indent]) {
if (indenterror(tok)) {
return ERRORTOKEN;
}
}
tok->pendin++;
tok->indstack[++tok->indent] = col;
tok->altindstack[tok->indent] = altcol;
}
else /* col < tok->indstack[tok->indent] */ {
/* Dedent -- any number, must be consistent */
while (tok->indent > 0 &&
col < tok->indstack[tok->indent]) {
tok->pendin--;
tok->indent--;
}
if (col != tok->indstack[tok->indent]) {
tok->done = E_DEDENT;
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (altcol != tok->altindstack[tok->indent]) {
if (indenterror(tok)) {
return ERRORTOKEN;
}
}
}
}
}
tok->start = tok->cur;
/* Return pending indents/dedents */
if (tok->pendin != 0) {
if (tok->pendin < 0) {
tok->pendin++;
return DEDENT;
}
else {
tok->pendin--;
return INDENT;
}
}
if (tok->async_def
&& !blankline
&& tok->level == 0
/* There was a NEWLINE after ASYNC DEF,
so we're past the signature. */
&& tok->async_def_nl
/* Current indentation level is less than where
the async function was defined */
&& tok->async_def_indent >= tok->indent)
{
tok->async_def = 0;
tok->async_def_indent = 0;
tok->async_def_nl = 0;
}
again:
tok->start = NULL;
/* Skip spaces */
do {
c = tok_nextc(tok);
} while (c == ' ' || c == '\t' || c == '\014');
/* Set start of current token */
tok->start = tok->cur - 1;
/* Skip comment, unless it's a type comment */
if (c == '#') {
const char *prefix, *p, *type_start;
while (c != EOF && c != '\n')
c = tok_nextc(tok);
p = tok->start;
prefix = type_comment_prefix;
while (*prefix && p < tok->cur) {
if (*prefix == ' ') {
while (*p == ' ' || *p == '\t')
p++;
} else if (*prefix == *p) {
p++;
} else {
break;
}
prefix++;
}
/* This is a type comment if we matched all of type_comment_prefix. */
if (!*prefix) {
int is_type_ignore = 1;
tok_backup(tok, c); /* don't eat the newline or EOF */
type_start = p;
is_type_ignore = tok->cur >= p + 6 && memcmp(p, "ignore", 6) == 0;
p += 6;
while (is_type_ignore && p < tok->cur) {
if (*p == '#')
break;
is_type_ignore = is_type_ignore && (*p == ' ' || *p == '\t');
p++;
}
if (is_type_ignore) {
/* If this type ignore is the only thing on the line, consume the newline also. */
if (blankline) {
tok_nextc(tok);
tok->atbol = 1;
}
return TYPE_IGNORE;
} else {
*p_start = (char *) type_start; /* after type_comment_prefix */
*p_end = tok->cur;
return TYPE_COMMENT;
}
}
}
/* Check for EOF and errors now */
if (c == EOF) {
return tok->done == E_EOF ? ENDMARKER : ERRORTOKEN;
}
/* Identifier (most frequent token!) */
nonascii = 0;
if (is_potential_identifier_start(c)) {
/* Process b"", r"", u"", br"" and rb"" */
int saw_b = 0, saw_r = 0, saw_u = 0, saw_f = 0;
while (1) {
if (!(saw_b || saw_u || saw_f) && (c == 'b' || c == 'B'))
saw_b = 1;
/* Since this is a backwards compatibility support literal we don't
want to support it in arbitrary order like byte literals. */
else if (!(saw_b || saw_u || saw_r || saw_f)
&& (c == 'u'|| c == 'U')) {
saw_u = 1;
}
/* ur"" and ru"" are not supported */
else if (!(saw_r || saw_u) && (c == 'r' || c == 'R')) {
saw_r = 1;
}
else if (!(saw_f || saw_b || saw_u) && (c == 'f' || c == 'F')) {
saw_f = 1;
}
else {
break;
}
c = tok_nextc(tok);
if (c == '"' || c == '\'') {
goto letter_quote;
}
}
while (is_potential_identifier_char(c)) {
if (c >= 128) {
nonascii = 1;
}
c = tok_nextc(tok);
}
tok_backup(tok, c);
if (nonascii && !verify_identifier(tok)) {
return ERRORTOKEN;
}
*p_start = tok->start;
*p_end = tok->cur;
/* async/await parsing block. */
if (tok->cur - tok->start == 5) {
/* Current token length is 5. */
if (tok->async_def) {
/* We're inside an 'async def' function. */
if (memcmp(tok->start, "async", 5) == 0) {
return ASYNC;
}
if (memcmp(tok->start, "await", 5) == 0) {
return AWAIT;
}
}
else if (memcmp(tok->start, "async", 5) == 0) {
/* The current token is 'async'.
Look ahead one token.*/
struct tok_state ahead_tok;
char *ahead_tok_start = NULL, *ahead_tok_end = NULL;
int ahead_tok_kind;
memcpy(&ahead_tok, tok, sizeof(ahead_tok));
ahead_tok_kind = tok_get(&ahead_tok, &ahead_tok_start,
&ahead_tok_end);
if (ahead_tok_kind == NAME
&& ahead_tok.cur - ahead_tok.start == 3
&& memcmp(ahead_tok.start, "def", 3) == 0)
{
/* The next token is going to be 'def', so instead of
returning 'async' NAME token, we return ASYNC. */
tok->async_def_indent = tok->indent;
tok->async_def = 1;
return ASYNC;
}
}
}
return NAME;
}
/* Newline */
if (c == '\n') {
tok->atbol = 1;
if (blankline || tok->level > 0) {
goto nextline;
}
*p_start = tok->start;
*p_end = tok->cur - 1; /* Leave '\n' out of the string */
tok->cont_line = 0;
if (tok->async_def) {
/* We're somewhere inside an 'async def' function, and
we've encountered a NEWLINE after its signature. */
tok->async_def_nl = 1;
}
return NEWLINE;
}
/* Period or number starting with period? */
if (c == '.') {
c = tok_nextc(tok);
if (isdigit(c)) {
goto fraction;
} else if (c == '.') {
c = tok_nextc(tok);
if (c == '.') {
*p_start = tok->start;
*p_end = tok->cur;
return ELLIPSIS;
}
else {
tok_backup(tok, c);
}
tok_backup(tok, '.');
}
else {
tok_backup(tok, c);
}
*p_start = tok->start;
*p_end = tok->cur;
return DOT;
}
/* Number */
if (isdigit(c)) {
if (c == '0') {
/* Hex, octal or binary -- maybe. */
c = tok_nextc(tok);
if (c == 'x' || c == 'X') {
/* Hex */
c = tok_nextc(tok);
do {
if (c == '_') {
c = tok_nextc(tok);
}
if (!isxdigit(c)) {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
do {
c = tok_nextc(tok);
} while (isxdigit(c));
} while (c == '_');
}
else if (c == 'o' || c == 'O') {
/* Octal */
c = tok_nextc(tok);
do {
if (c == '_') {
c = tok_nextc(tok);
}
if (c < '0' || c >= '8') {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
do {
c = tok_nextc(tok);
} while ('0' <= c && c < '8');
} while (c == '_');
}
else if (c == 'b' || c == 'B') {
/* Binary */
c = tok_nextc(tok);
do {
if (c == '_') {
c = tok_nextc(tok);
}
if (c != '0' && c != '1') {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
do {
c = tok_nextc(tok);
} while (c == '0' || c == '1');
} while (c == '_');
}
else {
int nonzero = 0;
/* maybe old-style octal; c is first char of it */
/* in any case, allow '0' as a literal */
while (1) {
if (c == '_') {
c = tok_nextc(tok);
if (!isdigit(c)) {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
}
if (c != '0') {
break;
}
c = tok_nextc(tok);
}
if (isdigit(c)) {
nonzero = 1;
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
}
if (c == '.') {
c = tok_nextc(tok);
goto fraction;
}
else if (c == 'e' || c == 'E') {
goto exponent;
}
else if (c == 'j' || c == 'J') {
goto imaginary;
}
else if (nonzero) {
/* Old-style octal: now disallowed. */
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
}
}
else {
/* Decimal */
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
{
/* Accept floating point numbers. */
if (c == '.') {
c = tok_nextc(tok);
fraction:
/* Fraction */
if (isdigit(c)) {
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
}
}
if (c == 'e' || c == 'E') {
int e;
exponent:
e = c;
/* Exponent part */
c = tok_nextc(tok);
if (c == '+' || c == '-') {
c = tok_nextc(tok);
if (!isdigit(c)) {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
} else if (!isdigit(c)) {
tok_backup(tok, c);
tok_backup(tok, e);
*p_start = tok->start;
*p_end = tok->cur;
return NUMBER;
}
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
}
if (c == 'j' || c == 'J') {
/* Imaginary part */
imaginary:
c = tok_nextc(tok);
}
}
}
tok_backup(tok, c);
*p_start = tok->start;
*p_end = tok->cur;
return NUMBER;
}
letter_quote:
/* String */
if (c == '\'' || c == '"') {
int quote = c;
int quote_size = 1; /* 1 or 3 */
int end_quote_size = 0;
/* Find the quote size and start of string */
c = tok_nextc(tok);
if (c == quote) {
c = tok_nextc(tok);
if (c == quote) {
quote_size = 3;
}
else {
end_quote_size = 1; /* empty string found */
}
}
if (c != quote) {
tok_backup(tok, c);
}
/* Get rest of string */
while (end_quote_size != quote_size) {
c = tok_nextc(tok);
if (c == EOF) {
if (quote_size == 3) {
tok->done = E_EOFS;
}
else {
tok->done = E_EOLS;
}
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (quote_size == 1 && c == '\n') {
tok->done = E_EOLS;
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (c == quote) {
end_quote_size += 1;
}
else {
end_quote_size = 0;
if (c == '\\') {
tok_nextc(tok); /* skip escaped char */
}
}
}
*p_start = tok->start;
*p_end = tok->cur;
return STRING;
}
/* Line continuation */
if (c == '\\') {
c = tok_nextc(tok);
if (c != '\n') {
tok->done = E_LINECONT;
tok->cur = tok->inp;
return ERRORTOKEN;
}
tok->cont_line = 1;
goto again; /* Read next line */
}
/* Check for two-character token */
{
int c2 = tok_nextc(tok);
int token = Ta3Token_TwoChars(c, c2);
if (token != OP) {
int c3 = tok_nextc(tok);
int token3 = Ta3Token_ThreeChars(c, c2, c3);
if (token3 != OP) {
token = token3;
}
else {
tok_backup(tok, c3);
}
*p_start = tok->start;
*p_end = tok->cur;
return token;
}
tok_backup(tok, c2);
}
/* Keep track of parentheses nesting level */
switch (c) {
case '(':
case '[':
case '{':
tok->level++;
break;
case ')':
case ']':
case '}':
tok->level--;
break;
}
/* Punctuation character */
*p_start = tok->start;
*p_end = tok->cur;
return Ta3Token_OneChar(c);
} | 2586 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | tok_get | tok_get( struct tok_state * tok , char ** p_start , char ** p_end) | ['tok', 'p_start', 'p_end'] | tok_get(struct tok_state *tok, char **p_start, char **p_end)
{
int c;
int blankline, nonascii;
*p_start = *p_end = NULL;
nextline:
tok->start = NULL;
blankline = 0;
/* Get indentation level */
if (tok->atbol) {
int col = 0;
int altcol = 0;
tok->atbol = 0;
for (;;) {
c = tok_nextc(tok);
if (c == ' ') {
col++, altcol++;
}
else if (c == '\t') {
col = (col/tok->tabsize + 1) * tok->tabsize;
altcol = (altcol/tok->alttabsize + 1)
* tok->alttabsize;
}
else if (c == '\014') {/* Control-L (formfeed) */
col = altcol = 0; /* For Emacs users */
}
else {
break;
}
}
tok_backup(tok, c);
if (c == '#' || c == '\n') {
/* Lines with only whitespace and/or comments
shouldn't affect the indentation and are
not passed to the parser as NEWLINE tokens,
except *totally* empty lines in interactive
mode, which signal the end of a command group. */
if (col == 0 && c == '\n' && tok->prompt != NULL) {
blankline = 0; /* Let it through */
}
else {
blankline = 1; /* Ignore completely */
}
/* We can't jump back right here since we still
may need to skip to the end of a comment */
}
if (!blankline && tok->level == 0) {
if (col == tok->indstack[tok->indent]) {
/* No change */
if (altcol != tok->altindstack[tok->indent]) {
if (indenterror(tok)) {
return ERRORTOKEN;
}
}
}
else if (col > tok->indstack[tok->indent]) {
/* Indent -- always one */
if (tok->indent+1 >= MAXINDENT) {
tok->done = E_TOODEEP;
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (altcol <= tok->altindstack[tok->indent]) {
if (indenterror(tok)) {
return ERRORTOKEN;
}
}
tok->pendin++;
tok->indstack[++tok->indent] = col;
tok->altindstack[tok->indent] = altcol;
}
else /* col < tok->indstack[tok->indent] */ {
/* Dedent -- any number, must be consistent */
while (tok->indent > 0 &&
col < tok->indstack[tok->indent]) {
tok->pendin--;
tok->indent--;
}
if (col != tok->indstack[tok->indent]) {
tok->done = E_DEDENT;
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (altcol != tok->altindstack[tok->indent]) {
if (indenterror(tok)) {
return ERRORTOKEN;
}
}
}
}
}
tok->start = tok->cur;
/* Return pending indents/dedents */
if (tok->pendin != 0) {
if (tok->pendin < 0) {
tok->pendin++;
return DEDENT;
}
else {
tok->pendin--;
return INDENT;
}
}
if (tok->async_def
&& !blankline
&& tok->level == 0
/* There was a NEWLINE after ASYNC DEF,
so we're past the signature. */
&& tok->async_def_nl
/* Current indentation level is less than where
the async function was defined */
&& tok->async_def_indent >= tok->indent)
{
tok->async_def = 0;
tok->async_def_indent = 0;
tok->async_def_nl = 0;
}
again:
tok->start = NULL;
/* Skip spaces */
do {
c = tok_nextc(tok);
} while (c == ' ' || c == '\t' || c == '\014');
/* Set start of current token */
tok->start = tok->cur - 1;
/* Skip comment, unless it's a type comment */
if (c == '#') {
const char *prefix, *p, *type_start;
while (c != EOF && c != '\n')
c = tok_nextc(tok);
p = tok->start;
prefix = type_comment_prefix;
while (*prefix && p < tok->cur) {
if (*prefix == ' ') {
while (*p == ' ' || *p == '\t')
p++;
} else if (*prefix == *p) {
p++;
} else {
break;
}
prefix++;
}
/* This is a type comment if we matched all of type_comment_prefix. */
if (!*prefix) {
int is_type_ignore = 1;
tok_backup(tok, c); /* don't eat the newline or EOF */
type_start = p;
is_type_ignore = tok->cur >= p + 6 && memcmp(p, "ignore", 6) == 0;
p += 6;
while (is_type_ignore && p < tok->cur) {
if (*p == '#')
break;
is_type_ignore = is_type_ignore && (*p == ' ' || *p == '\t');
p++;
}
if (is_type_ignore) {
/* If this type ignore is the only thing on the line, consume the newline also. */
if (blankline) {
tok_nextc(tok);
tok->atbol = 1;
}
return TYPE_IGNORE;
} else {
*p_start = (char *) type_start; /* after type_comment_prefix */
*p_end = tok->cur;
return TYPE_COMMENT;
}
}
}
/* Check for EOF and errors now */
if (c == EOF) {
return tok->done == E_EOF ? ENDMARKER : ERRORTOKEN;
}
/* Identifier (most frequent token!) */
nonascii = 0;
if (is_potential_identifier_start(c)) {
/* Process b"", r"", u"", br"" and rb"" */
int saw_b = 0, saw_r = 0, saw_u = 0, saw_f = 0;
while (1) {
if (!(saw_b || saw_u || saw_f) && (c == 'b' || c == 'B'))
saw_b = 1;
/* Since this is a backwards compatibility support literal we don't
want to support it in arbitrary order like byte literals. */
else if (!(saw_b || saw_u || saw_r || saw_f)
&& (c == 'u'|| c == 'U')) {
saw_u = 1;
}
/* ur"" and ru"" are not supported */
else if (!(saw_r || saw_u) && (c == 'r' || c == 'R')) {
saw_r = 1;
}
else if (!(saw_f || saw_b || saw_u) && (c == 'f' || c == 'F')) {
saw_f = 1;
}
else {
break;
}
c = tok_nextc(tok);
if (c == '"' || c == '\'') {
goto letter_quote;
}
}
while (is_potential_identifier_char(c)) {
if (c >= 128) {
nonascii = 1;
}
c = tok_nextc(tok);
}
tok_backup(tok, c);
if (nonascii && !verify_identifier(tok)) {
return ERRORTOKEN;
}
*p_start = tok->start;
*p_end = tok->cur;
/* async/await parsing block. */
if (tok->cur - tok->start == 5) {
/* Current token length is 5. */
if (tok->async_def) {
/* We're inside an 'async def' function. */
if (memcmp(tok->start, "async", 5) == 0) {
return ASYNC;
}
if (memcmp(tok->start, "await", 5) == 0) {
return AWAIT;
}
}
else if (memcmp(tok->start, "async", 5) == 0) {
/* The current token is 'async'.
Look ahead one token.*/
struct tok_state ahead_tok;
char *ahead_tok_start = NULL, *ahead_tok_end = NULL;
int ahead_tok_kind;
memcpy(&ahead_tok, tok, sizeof(ahead_tok));
ahead_tok_kind = tok_get(&ahead_tok, &ahead_tok_start,
&ahead_tok_end);
if (ahead_tok_kind == NAME
&& ahead_tok.cur - ahead_tok.start == 3
&& memcmp(ahead_tok.start, "def", 3) == 0)
{
/* The next token is going to be 'def', so instead of
returning 'async' NAME token, we return ASYNC. */
tok->async_def_indent = tok->indent;
tok->async_def = 1;
return ASYNC;
}
}
}
return NAME;
}
/* Newline */
if (c == '\n') {
tok->atbol = 1;
if (blankline || tok->level > 0) {
goto nextline;
}
*p_start = tok->start;
*p_end = tok->cur - 1; /* Leave '\n' out of the string */
tok->cont_line = 0;
if (tok->async_def) {
/* We're somewhere inside an 'async def' function, and
we've encountered a NEWLINE after its signature. */
tok->async_def_nl = 1;
}
return NEWLINE;
}
/* Period or number starting with period? */
if (c == '.') {
c = tok_nextc(tok);
if (isdigit(c)) {
goto fraction;
} else if (c == '.') {
c = tok_nextc(tok);
if (c == '.') {
*p_start = tok->start;
*p_end = tok->cur;
return ELLIPSIS;
}
else {
tok_backup(tok, c);
}
tok_backup(tok, '.');
}
else {
tok_backup(tok, c);
}
*p_start = tok->start;
*p_end = tok->cur;
return DOT;
}
/* Number */
if (isdigit(c)) {
if (c == '0') {
/* Hex, octal or binary -- maybe. */
c = tok_nextc(tok);
if (c == 'x' || c == 'X') {
/* Hex */
c = tok_nextc(tok);
do {
if (c == '_') {
c = tok_nextc(tok);
}
if (!isxdigit(c)) {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
do {
c = tok_nextc(tok);
} while (isxdigit(c));
} while (c == '_');
}
else if (c == 'o' || c == 'O') {
/* Octal */
c = tok_nextc(tok);
do {
if (c == '_') {
c = tok_nextc(tok);
}
if (c < '0' || c >= '8') {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
do {
c = tok_nextc(tok);
} while ('0' <= c && c < '8');
} while (c == '_');
}
else if (c == 'b' || c == 'B') {
/* Binary */
c = tok_nextc(tok);
do {
if (c == '_') {
c = tok_nextc(tok);
}
if (c != '0' && c != '1') {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
do {
c = tok_nextc(tok);
} while (c == '0' || c == '1');
} while (c == '_');
}
else {
int nonzero = 0;
/* maybe old-style octal; c is first char of it */
/* in any case, allow '0' as a literal */
while (1) {
if (c == '_') {
c = tok_nextc(tok);
if (!isdigit(c)) {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
}
if (c != '0') {
break;
}
c = tok_nextc(tok);
}
if (isdigit(c)) {
nonzero = 1;
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
}
if (c == '.') {
c = tok_nextc(tok);
goto fraction;
}
else if (c == 'e' || c == 'E') {
goto exponent;
}
else if (c == 'j' || c == 'J') {
goto imaginary;
}
else if (nonzero) {
/* Old-style octal: now disallowed. */
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
}
}
else {
/* Decimal */
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
{
/* Accept floating point numbers. */
if (c == '.') {
c = tok_nextc(tok);
fraction:
/* Fraction */
if (isdigit(c)) {
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
}
}
if (c == 'e' || c == 'E') {
int e;
exponent:
e = c;
/* Exponent part */
c = tok_nextc(tok);
if (c == '+' || c == '-') {
c = tok_nextc(tok);
if (!isdigit(c)) {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;
}
} else if (!isdigit(c)) {
tok_backup(tok, c);
tok_backup(tok, e);
*p_start = tok->start;
*p_end = tok->cur;
return NUMBER;
}
c = tok_decimal_tail(tok);
if (c == 0) {
return ERRORTOKEN;
}
}
if (c == 'j' || c == 'J') {
/* Imaginary part */
imaginary:
c = tok_nextc(tok);
}
}
}
tok_backup(tok, c);
*p_start = tok->start;
*p_end = tok->cur;
return NUMBER;
}
letter_quote:
/* String */
if (c == '\'' || c == '"') {
int quote = c;
int quote_size = 1; /* 1 or 3 */
int end_quote_size = 0;
/* Find the quote size and start of string */
c = tok_nextc(tok);
if (c == quote) {
c = tok_nextc(tok);
if (c == quote) {
quote_size = 3;
}
else {
end_quote_size = 1; /* empty string found */
}
}
if (c != quote) {
tok_backup(tok, c);
}
/* Get rest of string */
while (end_quote_size != quote_size) {
c = tok_nextc(tok);
if (c == EOF) {
if (quote_size == 3) {
tok->done = E_EOFS;
}
else {
tok->done = E_EOLS;
}
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (quote_size == 1 && c == '\n') {
tok->done = E_EOLS;
tok->cur = tok->inp;
return ERRORTOKEN;
}
if (c == quote) {
end_quote_size += 1;
}
else {
end_quote_size = 0;
if (c == '\\') {
tok_nextc(tok); /* skip escaped char */
}
}
}
*p_start = tok->start;
*p_end = tok->cur;
return STRING;
}
/* Line continuation */
if (c == '\\') {
c = tok_nextc(tok);
if (c != '\n') {
tok->done = E_LINECONT;
tok->cur = tok->inp;
return ERRORTOKEN;
}
tok->cont_line = 1;
goto again; /* Read next line */
}
/* Check for two-character token */
{
int c2 = tok_nextc(tok);
int token = Ta3Token_TwoChars(c, c2);
if (token != OP) {
int c3 = tok_nextc(tok);
int token3 = Ta3Token_ThreeChars(c, c2, c3);
if (token3 != OP) {
token = token3;
}
else {
tok_backup(tok, c3);
}
*p_start = tok->start;
*p_end = tok->cur;
return token;
}
tok_backup(tok, c2);
}
/* Keep track of parentheses nesting level */
switch (c) {
case '(':
case '[':
case '{':
tok->level++;
break;
case ')':
case ']':
case '}':
tok->level--;
break;
}
/* Punctuation character */
*p_start = tok->start;
*p_end = tok->cur;
return Ta3Token_OneChar(c);
} | 2586 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | tok_new | tok_new( void) | ['void'] | tok_new(void)
{
struct tok_state *tok = (struct tok_state *)PyMem_MALLOC(
sizeof(struct tok_state));
if (tok == NULL)
return NULL;
tok->buf = tok->cur = tok->end = tok->inp = tok->start = NULL;
tok->done = E_OK;
tok->fp = NULL;
tok->input = NULL;
tok->tabsize = TABSIZE;
tok->indent = 0;
tok->indstack[0] = 0;
tok->atbol = 1;
tok->pendin = 0;
tok->prompt = tok->nextprompt = NULL;
tok->lineno = 0;
tok->level = 0;
tok->altwarning = 1;
tok->alterror = 1;
tok->alttabsize = 1;
tok->altindstack[0] = 0;
tok->decoding_state = STATE_INIT;
tok->decoding_erred = 0;
tok->read_coding_spec = 0;
tok->enc = NULL;
tok->encoding = NULL;
tok->cont_line = 0;
#ifndef PGEN
tok->filename = NULL;
tok->decoding_readline = NULL;
tok->decoding_buffer = NULL;
#endif
tok->async_def = 0;
tok->async_def_indent = 0;
tok->async_def_nl = 0;
return tok;
} | 231 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | tok_new | tok_new( void) | ['void'] | tok_new(void)
{
struct tok_state *tok = (struct tok_state *)PyMem_MALLOC(
sizeof(struct tok_state));
if (tok == NULL)
return NULL;
tok->buf = tok->cur = tok->end = tok->inp = tok->start = NULL;
tok->done = E_OK;
tok->fp = NULL;
tok->input = NULL;
tok->tabsize = TABSIZE;
tok->indent = 0;
tok->indstack[0] = 0;
tok->atbol = 1;
tok->pendin = 0;
tok->prompt = tok->nextprompt = NULL;
tok->lineno = 0;
tok->level = 0;
tok->altwarning = 1;
tok->alterror = 1;
tok->alttabsize = 1;
tok->altindstack[0] = 0;
tok->decoding_state = STATE_INIT;
tok->decoding_erred = 0;
tok->read_coding_spec = 0;
tok->enc = NULL;
tok->encoding = NULL;
tok->cont_line = 0;
#ifndef PGEN
tok->filename = NULL;
tok->decoding_readline = NULL;
tok->decoding_buffer = NULL;
#endif
tok->async_def = 0;
tok->async_def_indent = 0;
tok->async_def_nl = 0;
return tok;
} | 231 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | PyInit__ast3 | PyInit__ast3( void) | ['void'] | PyInit__ast3(void)
{
PyObject *m, *d;
if (!init_types()) return NULL;
m = PyModule_Create(&_astmodule3);
if (!m) return NULL;
d = PyModule_GetDict(m);
if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;
if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0)
return NULL;
if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Interactive", (PyObject*)Interactive_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Expression", (PyObject*)Expression_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "FunctionType", (PyObject*)FunctionType_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Suite", (PyObject*)Suite_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "stmt", (PyObject*)stmt_type) < 0) return NULL;
if (PyDict_SetItemString(d, "FunctionDef", (PyObject*)FunctionDef_type) <
0) return NULL;
if (PyDict_SetItemString(d, "AsyncFunctionDef",
(PyObject*)AsyncFunctionDef_type) < 0) return NULL;
if (PyDict_SetItemString(d, "ClassDef", (PyObject*)ClassDef_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Return", (PyObject*)Return_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Delete", (PyObject*)Delete_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Assign", (PyObject*)Assign_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "AugAssign", (PyObject*)AugAssign_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "AnnAssign", (PyObject*)AnnAssign_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "For", (PyObject*)For_type) < 0) return NULL;
if (PyDict_SetItemString(d, "AsyncFor", (PyObject*)AsyncFor_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "While", (PyObject*)While_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "If", (PyObject*)If_type) < 0) return NULL;
if (PyDict_SetItemString(d, "With", (PyObject*)With_type) < 0) return NULL;
if (PyDict_SetItemString(d, "AsyncWith", (PyObject*)AsyncWith_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Raise", (PyObject*)Raise_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Try", (PyObject*)Try_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Assert", (PyObject*)Assert_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Import", (PyObject*)Import_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "ImportFrom", (PyObject*)ImportFrom_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Global", (PyObject*)Global_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Nonlocal", (PyObject*)Nonlocal_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Expr", (PyObject*)Expr_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Pass", (PyObject*)Pass_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Break", (PyObject*)Break_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Continue", (PyObject*)Continue_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "expr", (PyObject*)expr_type) < 0) return NULL;
if (PyDict_SetItemString(d, "BoolOp", (PyObject*)BoolOp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BinOp", (PyObject*)BinOp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "UnaryOp", (PyObject*)UnaryOp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Lambda", (PyObject*)Lambda_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "IfExp", (PyObject*)IfExp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Dict", (PyObject*)Dict_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Set", (PyObject*)Set_type) < 0) return NULL;
if (PyDict_SetItemString(d, "ListComp", (PyObject*)ListComp_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "SetComp", (PyObject*)SetComp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "DictComp", (PyObject*)DictComp_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "GeneratorExp", (PyObject*)GeneratorExp_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Await", (PyObject*)Await_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Yield", (PyObject*)Yield_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "YieldFrom", (PyObject*)YieldFrom_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Compare", (PyObject*)Compare_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Call", (PyObject*)Call_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Num", (PyObject*)Num_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Str", (PyObject*)Str_type) < 0) return NULL;
if (PyDict_SetItemString(d, "FormattedValue",
(PyObject*)FormattedValue_type) < 0) return NULL;
if (PyDict_SetItemString(d, "JoinedStr", (PyObject*)JoinedStr_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Bytes", (PyObject*)Bytes_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "NameConstant", (PyObject*)NameConstant_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Ellipsis", (PyObject*)Ellipsis_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Constant", (PyObject*)Constant_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Attribute", (PyObject*)Attribute_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Subscript", (PyObject*)Subscript_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Starred", (PyObject*)Starred_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Name", (PyObject*)Name_type) < 0) return NULL;
if (PyDict_SetItemString(d, "List", (PyObject*)List_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Tuple", (PyObject*)Tuple_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "expr_context", (PyObject*)expr_context_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Load", (PyObject*)Load_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Store", (PyObject*)Store_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Del", (PyObject*)Del_type) < 0) return NULL;
if (PyDict_SetItemString(d, "AugLoad", (PyObject*)AugLoad_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "AugStore", (PyObject*)AugStore_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Param", (PyObject*)Param_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "slice", (PyObject*)slice_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Slice", (PyObject*)Slice_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "ExtSlice", (PyObject*)ExtSlice_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Index", (PyObject*)Index_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "boolop", (PyObject*)boolop_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "And", (PyObject*)And_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Or", (PyObject*)Or_type) < 0) return NULL;
if (PyDict_SetItemString(d, "operator", (PyObject*)operator_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Add", (PyObject*)Add_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Sub", (PyObject*)Sub_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Mult", (PyObject*)Mult_type) < 0) return NULL;
if (PyDict_SetItemString(d, "MatMult", (PyObject*)MatMult_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Div", (PyObject*)Div_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Mod", (PyObject*)Mod_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Pow", (PyObject*)Pow_type) < 0) return NULL;
if (PyDict_SetItemString(d, "LShift", (PyObject*)LShift_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "RShift", (PyObject*)RShift_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BitOr", (PyObject*)BitOr_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BitXor", (PyObject*)BitXor_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BitAnd", (PyObject*)BitAnd_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "FloorDiv", (PyObject*)FloorDiv_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "unaryop", (PyObject*)unaryop_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Invert", (PyObject*)Invert_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Not", (PyObject*)Not_type) < 0) return NULL;
if (PyDict_SetItemString(d, "UAdd", (PyObject*)UAdd_type) < 0) return NULL;
if (PyDict_SetItemString(d, "USub", (PyObject*)USub_type) < 0) return NULL;
if (PyDict_SetItemString(d, "cmpop", (PyObject*)cmpop_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Eq", (PyObject*)Eq_type) < 0) return NULL;
if (PyDict_SetItemString(d, "NotEq", (PyObject*)NotEq_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Lt", (PyObject*)Lt_type) < 0) return NULL;
if (PyDict_SetItemString(d, "LtE", (PyObject*)LtE_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Gt", (PyObject*)Gt_type) < 0) return NULL;
if (PyDict_SetItemString(d, "GtE", (PyObject*)GtE_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Is", (PyObject*)Is_type) < 0) return NULL;
if (PyDict_SetItemString(d, "IsNot", (PyObject*)IsNot_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "In", (PyObject*)In_type) < 0) return NULL;
if (PyDict_SetItemString(d, "NotIn", (PyObject*)NotIn_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "comprehension", (PyObject*)comprehension_type)
< 0) return NULL;
if (PyDict_SetItemString(d, "excepthandler", (PyObject*)excepthandler_type)
< 0) return NULL;
if (PyDict_SetItemString(d, "ExceptHandler", (PyObject*)ExceptHandler_type)
< 0) return NULL;
if (PyDict_SetItemString(d, "arguments", (PyObject*)arguments_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "arg", (PyObject*)arg_type) < 0) return NULL;
if (PyDict_SetItemString(d, "keyword", (PyObject*)keyword_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "alias", (PyObject*)alias_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "withitem", (PyObject*)withitem_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "type_ignore", (PyObject*)type_ignore_type) <
0) return NULL;
if (PyDict_SetItemString(d, "TypeIgnore", (PyObject*)TypeIgnore_type) < 0)
return NULL;
return m;
} | 2424 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | PyInit__ast3 | PyInit__ast3( void) | ['void'] | PyInit__ast3(void)
{
PyObject *m, *d;
if (!init_types()) return NULL;
m = PyModule_Create(&_astmodule3);
if (!m) return NULL;
d = PyModule_GetDict(m);
if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return NULL;
if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0)
return NULL;
if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Interactive", (PyObject*)Interactive_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Expression", (PyObject*)Expression_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "FunctionType", (PyObject*)FunctionType_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Suite", (PyObject*)Suite_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "stmt", (PyObject*)stmt_type) < 0) return NULL;
if (PyDict_SetItemString(d, "FunctionDef", (PyObject*)FunctionDef_type) <
0) return NULL;
if (PyDict_SetItemString(d, "AsyncFunctionDef",
(PyObject*)AsyncFunctionDef_type) < 0) return NULL;
if (PyDict_SetItemString(d, "ClassDef", (PyObject*)ClassDef_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Return", (PyObject*)Return_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Delete", (PyObject*)Delete_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Assign", (PyObject*)Assign_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "AugAssign", (PyObject*)AugAssign_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "AnnAssign", (PyObject*)AnnAssign_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "For", (PyObject*)For_type) < 0) return NULL;
if (PyDict_SetItemString(d, "AsyncFor", (PyObject*)AsyncFor_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "While", (PyObject*)While_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "If", (PyObject*)If_type) < 0) return NULL;
if (PyDict_SetItemString(d, "With", (PyObject*)With_type) < 0) return NULL;
if (PyDict_SetItemString(d, "AsyncWith", (PyObject*)AsyncWith_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Raise", (PyObject*)Raise_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Try", (PyObject*)Try_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Assert", (PyObject*)Assert_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Import", (PyObject*)Import_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "ImportFrom", (PyObject*)ImportFrom_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Global", (PyObject*)Global_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Nonlocal", (PyObject*)Nonlocal_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Expr", (PyObject*)Expr_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Pass", (PyObject*)Pass_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Break", (PyObject*)Break_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Continue", (PyObject*)Continue_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "expr", (PyObject*)expr_type) < 0) return NULL;
if (PyDict_SetItemString(d, "BoolOp", (PyObject*)BoolOp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BinOp", (PyObject*)BinOp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "UnaryOp", (PyObject*)UnaryOp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Lambda", (PyObject*)Lambda_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "IfExp", (PyObject*)IfExp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Dict", (PyObject*)Dict_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Set", (PyObject*)Set_type) < 0) return NULL;
if (PyDict_SetItemString(d, "ListComp", (PyObject*)ListComp_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "SetComp", (PyObject*)SetComp_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "DictComp", (PyObject*)DictComp_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "GeneratorExp", (PyObject*)GeneratorExp_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Await", (PyObject*)Await_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Yield", (PyObject*)Yield_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "YieldFrom", (PyObject*)YieldFrom_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Compare", (PyObject*)Compare_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Call", (PyObject*)Call_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Num", (PyObject*)Num_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Str", (PyObject*)Str_type) < 0) return NULL;
if (PyDict_SetItemString(d, "FormattedValue",
(PyObject*)FormattedValue_type) < 0) return NULL;
if (PyDict_SetItemString(d, "JoinedStr", (PyObject*)JoinedStr_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Bytes", (PyObject*)Bytes_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "NameConstant", (PyObject*)NameConstant_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Ellipsis", (PyObject*)Ellipsis_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Constant", (PyObject*)Constant_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Attribute", (PyObject*)Attribute_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Subscript", (PyObject*)Subscript_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Starred", (PyObject*)Starred_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Name", (PyObject*)Name_type) < 0) return NULL;
if (PyDict_SetItemString(d, "List", (PyObject*)List_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Tuple", (PyObject*)Tuple_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "expr_context", (PyObject*)expr_context_type) <
0) return NULL;
if (PyDict_SetItemString(d, "Load", (PyObject*)Load_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Store", (PyObject*)Store_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Del", (PyObject*)Del_type) < 0) return NULL;
if (PyDict_SetItemString(d, "AugLoad", (PyObject*)AugLoad_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "AugStore", (PyObject*)AugStore_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Param", (PyObject*)Param_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "slice", (PyObject*)slice_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Slice", (PyObject*)Slice_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "ExtSlice", (PyObject*)ExtSlice_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Index", (PyObject*)Index_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "boolop", (PyObject*)boolop_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "And", (PyObject*)And_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Or", (PyObject*)Or_type) < 0) return NULL;
if (PyDict_SetItemString(d, "operator", (PyObject*)operator_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "Add", (PyObject*)Add_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Sub", (PyObject*)Sub_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Mult", (PyObject*)Mult_type) < 0) return NULL;
if (PyDict_SetItemString(d, "MatMult", (PyObject*)MatMult_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Div", (PyObject*)Div_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Mod", (PyObject*)Mod_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Pow", (PyObject*)Pow_type) < 0) return NULL;
if (PyDict_SetItemString(d, "LShift", (PyObject*)LShift_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "RShift", (PyObject*)RShift_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BitOr", (PyObject*)BitOr_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BitXor", (PyObject*)BitXor_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "BitAnd", (PyObject*)BitAnd_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "FloorDiv", (PyObject*)FloorDiv_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "unaryop", (PyObject*)unaryop_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Invert", (PyObject*)Invert_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Not", (PyObject*)Not_type) < 0) return NULL;
if (PyDict_SetItemString(d, "UAdd", (PyObject*)UAdd_type) < 0) return NULL;
if (PyDict_SetItemString(d, "USub", (PyObject*)USub_type) < 0) return NULL;
if (PyDict_SetItemString(d, "cmpop", (PyObject*)cmpop_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Eq", (PyObject*)Eq_type) < 0) return NULL;
if (PyDict_SetItemString(d, "NotEq", (PyObject*)NotEq_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Lt", (PyObject*)Lt_type) < 0) return NULL;
if (PyDict_SetItemString(d, "LtE", (PyObject*)LtE_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Gt", (PyObject*)Gt_type) < 0) return NULL;
if (PyDict_SetItemString(d, "GtE", (PyObject*)GtE_type) < 0) return NULL;
if (PyDict_SetItemString(d, "Is", (PyObject*)Is_type) < 0) return NULL;
if (PyDict_SetItemString(d, "IsNot", (PyObject*)IsNot_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "In", (PyObject*)In_type) < 0) return NULL;
if (PyDict_SetItemString(d, "NotIn", (PyObject*)NotIn_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "comprehension", (PyObject*)comprehension_type)
< 0) return NULL;
if (PyDict_SetItemString(d, "excepthandler", (PyObject*)excepthandler_type)
< 0) return NULL;
if (PyDict_SetItemString(d, "ExceptHandler", (PyObject*)ExceptHandler_type)
< 0) return NULL;
if (PyDict_SetItemString(d, "arguments", (PyObject*)arguments_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "arg", (PyObject*)arg_type) < 0) return NULL;
if (PyDict_SetItemString(d, "keyword", (PyObject*)keyword_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "alias", (PyObject*)alias_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "withitem", (PyObject*)withitem_type) < 0)
return NULL;
if (PyDict_SetItemString(d, "type_ignore", (PyObject*)type_ignore_type) <
0) return NULL;
if (PyDict_SetItemString(d, "TypeIgnore", (PyObject*)TypeIgnore_type) < 0)
return NULL;
return m;
} | 2424 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | add_ast_fields | add_ast_fields( void) | ['void'] | static int add_ast_fields(void)
{
PyObject *empty_tuple, *d;
if (PyType_Ready(&AST_type) < 0)
return -1;
d = AST_type.tp_dict;
empty_tuple = PyTuple_New(0);
if (!empty_tuple ||
PyDict_SetItemString(d, "_fields", empty_tuple) < 0 ||
PyDict_SetItemString(d, "_attributes", empty_tuple) < 0) {
Py_XDECREF(empty_tuple);
return -1;
}
Py_DECREF(empty_tuple);
return 0;
} | 86 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | add_ast_fields | add_ast_fields( void) | ['void'] | static int add_ast_fields(void)
{
PyObject *empty_tuple, *d;
if (PyType_Ready(&AST_type) < 0)
return -1;
d = AST_type.tp_dict;
empty_tuple = PyTuple_New(0);
if (!empty_tuple ||
PyDict_SetItemString(d, "_fields", empty_tuple) < 0 ||
PyDict_SetItemString(d, "_attributes", empty_tuple) < 0) {
Py_XDECREF(empty_tuple);
return -1;
}
Py_DECREF(empty_tuple);
return 0;
} | 86 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | add_attributes | add_attributes( PyTypeObject * type , char ** attrs , int num_fields) | ['type', 'attrs', 'num_fields'] | static int add_attributes(PyTypeObject* type, char**attrs, int num_fields)
{
int i, result;
_Py_IDENTIFIER(_attributes);
PyObject *s, *l = PyTuple_New(num_fields);
if (!l)
return 0;
for (i = 0; i < num_fields; i++) {
s = PyUnicode_FromString(attrs[i]);
if (!s) {
Py_DECREF(l);
return 0;
}
PyTuple_SET_ITEM(l, i, s);
}
result = _PyObject_SetAttrId((PyObject*)type, &PyId__attributes, l) >= 0;
Py_DECREF(l);
return result;
} | 120 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | add_attributes | add_attributes( PyTypeObject * type , char ** attrs , int num_fields) | ['type', 'attrs', 'num_fields'] | static int add_attributes(PyTypeObject* type, char**attrs, int num_fields)
{
int i, result;
_Py_IDENTIFIER(_attributes);
PyObject *s, *l = PyTuple_New(num_fields);
if (!l)
return 0;
for (i = 0; i < num_fields; i++) {
s = PyUnicode_FromString(attrs[i]);
if (!s) {
Py_DECREF(l);
return 0;
}
PyTuple_SET_ITEM(l, i, s);
}
result = _PyObject_SetAttrId((PyObject*)type, &PyId__attributes, l) >= 0;
Py_DECREF(l);
return result;
} | 120 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_alias | ast2obj_alias( void * _o) | ['_o'] | ast2obj_alias(void* _o)
{
alias_ty o = (alias_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(alias_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_identifier(o->name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_identifier(o->asname);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_asname, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 159 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_alias | ast2obj_alias( void * _o) | ['_o'] | ast2obj_alias(void* _o)
{
alias_ty o = (alias_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(alias_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_identifier(o->name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_identifier(o->asname);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_asname, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 159 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_arg | ast2obj_arg( void * _o) | ['_o'] | ast2obj_arg(void* _o)
{
arg_ty o = (arg_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(arg_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_identifier(o->arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_arg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->annotation);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_annotation, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 277 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_arg | ast2obj_arg( void * _o) | ['_o'] | ast2obj_arg(void* _o)
{
arg_ty o = (arg_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(arg_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_identifier(o->arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_arg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->annotation);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_annotation, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 277 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_arguments | ast2obj_arguments( void * _o) | ['_o'] | ast2obj_arguments(void* _o)
{
arguments_ty o = (arguments_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(arguments_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_list(o->args, ast2obj_arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arg(o->vararg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_vararg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->kwonlyargs, ast2obj_arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kwonlyargs, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->kw_defaults, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kw_defaults, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arg(o->kwarg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kwarg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->defaults, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_defaults, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 327 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_arguments | ast2obj_arguments( void * _o) | ['_o'] | ast2obj_arguments(void* _o)
{
arguments_ty o = (arguments_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(arguments_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_list(o->args, ast2obj_arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arg(o->vararg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_vararg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->kwonlyargs, ast2obj_arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kwonlyargs, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->kw_defaults, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kw_defaults, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arg(o->kwarg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kwarg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->defaults, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_defaults, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 327 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_comprehension | ast2obj_comprehension( void * _o) | ['_o'] | ast2obj_comprehension(void* _o)
{
comprehension_ty o = (comprehension_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(comprehension_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_expr(o->target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->iter);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_iter, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->ifs, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ifs, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->is_async);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_is_async, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 241 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_comprehension | ast2obj_comprehension( void * _o) | ['_o'] | ast2obj_comprehension(void* _o)
{
comprehension_ty o = (comprehension_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(comprehension_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_expr(o->target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->iter);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_iter, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->ifs, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ifs, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->is_async);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_is_async, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 241 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_excepthandler | ast2obj_excepthandler( void * _o) | ['_o'] | ast2obj_excepthandler(void* _o)
{
excepthandler_ty o = (excepthandler_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case ExceptHandler_kind:
result = PyType_GenericNew(ExceptHandler_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.ExceptHandler.type);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_identifier(o->v.ExceptHandler.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ExceptHandler.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 304 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_excepthandler | ast2obj_excepthandler( void * _o) | ['_o'] | ast2obj_excepthandler(void* _o)
{
excepthandler_ty o = (excepthandler_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case ExceptHandler_kind:
result = PyType_GenericNew(ExceptHandler_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.ExceptHandler.type);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_identifier(o->v.ExceptHandler.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ExceptHandler.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 304 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_expr | ast2obj_expr( void * _o) | ['_o'] | ast2obj_expr(void* _o)
{
expr_ty o = (expr_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case BoolOp_kind:
result = PyType_GenericNew(BoolOp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_boolop(o->v.BoolOp.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.BoolOp.values, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_values, value) == -1)
goto failed;
Py_DECREF(value);
break;
case BinOp_kind:
result = PyType_GenericNew(BinOp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.BinOp.left);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_left, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_operator(o->v.BinOp.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.BinOp.right);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_right, value) == -1)
goto failed;
Py_DECREF(value);
break;
case UnaryOp_kind:
result = PyType_GenericNew(UnaryOp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_unaryop(o->v.UnaryOp.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.UnaryOp.operand);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_operand, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Lambda_kind:
result = PyType_GenericNew(Lambda_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_arguments(o->v.Lambda.args);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Lambda.body);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
case IfExp_kind:
result = PyType_GenericNew(IfExp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.IfExp.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.IfExp.body);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.IfExp.orelse);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Dict_kind:
result = PyType_GenericNew(Dict_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Dict.keys, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_keys, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Dict.values, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_values, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Set_kind:
result = PyType_GenericNew(Set_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Set.elts, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elts, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ListComp_kind:
result = PyType_GenericNew(ListComp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.ListComp.elt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elt, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ListComp.generators, ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case SetComp_kind:
result = PyType_GenericNew(SetComp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.SetComp.elt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elt, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.SetComp.generators, ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case DictComp_kind:
result = PyType_GenericNew(DictComp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.DictComp.key);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_key, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.DictComp.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.DictComp.generators, ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case GeneratorExp_kind:
result = PyType_GenericNew(GeneratorExp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.GeneratorExp.elt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elt, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.GeneratorExp.generators,
ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Await_kind:
result = PyType_GenericNew(Await_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Await.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Yield_kind:
result = PyType_GenericNew(Yield_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Yield.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case YieldFrom_kind:
result = PyType_GenericNew(YieldFrom_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.YieldFrom.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Compare_kind:
result = PyType_GenericNew(Compare_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Compare.left);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_left, value) == -1)
goto failed;
Py_DECREF(value);
{
Py_ssize_t i, n = asdl_seq_LEN(o->v.Compare.ops);
value = PyList_New(n);
if (!value) goto failed;
for(i = 0; i < n; i++)
PyList_SET_ITEM(value, i, ast2obj_cmpop((cmpop_ty)asdl_seq_GET(o->v.Compare.ops, i)));
}
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ops, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Compare.comparators, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_comparators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Call_kind:
result = PyType_GenericNew(Call_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Call.func);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_func, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Call.args, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Call.keywords, ast2obj_keyword);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_keywords, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Num_kind:
result = PyType_GenericNew(Num_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_object(o->v.Num.n);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_n, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Str_kind:
result = PyType_GenericNew(Str_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_string(o->v.Str.s);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_s, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.Str.kind);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kind, value) == -1)
goto failed;
Py_DECREF(value);
break;
case FormattedValue_kind:
result = PyType_GenericNew(FormattedValue_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.FormattedValue.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->v.FormattedValue.conversion);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_conversion, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.FormattedValue.format_spec);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_format_spec, value) == -1)
goto failed;
Py_DECREF(value);
break;
case JoinedStr_kind:
result = PyType_GenericNew(JoinedStr_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.JoinedStr.values, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_values, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Bytes_kind:
result = PyType_GenericNew(Bytes_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_bytes(o->v.Bytes.s);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_s, value) == -1)
goto failed;
Py_DECREF(value);
break;
case NameConstant_kind:
result = PyType_GenericNew(NameConstant_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_singleton(o->v.NameConstant.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Ellipsis_kind:
result = PyType_GenericNew(Ellipsis_type, NULL, NULL);
if (!result) goto failed;
break;
case Constant_kind:
result = PyType_GenericNew(Constant_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_constant(o->v.Constant.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Attribute_kind:
result = PyType_GenericNew(Attribute_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Attribute.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_identifier(o->v.Attribute.attr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_attr, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Attribute.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Subscript_kind:
result = PyType_GenericNew(Subscript_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Subscript.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_slice(o->v.Subscript.slice);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_slice, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Subscript.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Starred_kind:
result = PyType_GenericNew(Starred_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Starred.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Starred.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Name_kind:
result = PyType_GenericNew(Name_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.Name.id);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_id, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Name.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case List_kind:
result = PyType_GenericNew(List_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.List.elts, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elts, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.List.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Tuple_kind:
result = PyType_GenericNew(Tuple_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Tuple.elts, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elts, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Tuple.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 3461 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_expr | ast2obj_expr( void * _o) | ['_o'] | ast2obj_expr(void* _o)
{
expr_ty o = (expr_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case BoolOp_kind:
result = PyType_GenericNew(BoolOp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_boolop(o->v.BoolOp.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.BoolOp.values, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_values, value) == -1)
goto failed;
Py_DECREF(value);
break;
case BinOp_kind:
result = PyType_GenericNew(BinOp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.BinOp.left);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_left, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_operator(o->v.BinOp.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.BinOp.right);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_right, value) == -1)
goto failed;
Py_DECREF(value);
break;
case UnaryOp_kind:
result = PyType_GenericNew(UnaryOp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_unaryop(o->v.UnaryOp.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.UnaryOp.operand);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_operand, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Lambda_kind:
result = PyType_GenericNew(Lambda_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_arguments(o->v.Lambda.args);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Lambda.body);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
case IfExp_kind:
result = PyType_GenericNew(IfExp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.IfExp.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.IfExp.body);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.IfExp.orelse);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Dict_kind:
result = PyType_GenericNew(Dict_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Dict.keys, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_keys, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Dict.values, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_values, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Set_kind:
result = PyType_GenericNew(Set_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Set.elts, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elts, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ListComp_kind:
result = PyType_GenericNew(ListComp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.ListComp.elt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elt, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ListComp.generators, ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case SetComp_kind:
result = PyType_GenericNew(SetComp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.SetComp.elt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elt, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.SetComp.generators, ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case DictComp_kind:
result = PyType_GenericNew(DictComp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.DictComp.key);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_key, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.DictComp.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.DictComp.generators, ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case GeneratorExp_kind:
result = PyType_GenericNew(GeneratorExp_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.GeneratorExp.elt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elt, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.GeneratorExp.generators,
ast2obj_comprehension);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_generators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Await_kind:
result = PyType_GenericNew(Await_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Await.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Yield_kind:
result = PyType_GenericNew(Yield_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Yield.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case YieldFrom_kind:
result = PyType_GenericNew(YieldFrom_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.YieldFrom.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Compare_kind:
result = PyType_GenericNew(Compare_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Compare.left);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_left, value) == -1)
goto failed;
Py_DECREF(value);
{
Py_ssize_t i, n = asdl_seq_LEN(o->v.Compare.ops);
value = PyList_New(n);
if (!value) goto failed;
for(i = 0; i < n; i++)
PyList_SET_ITEM(value, i, ast2obj_cmpop((cmpop_ty)asdl_seq_GET(o->v.Compare.ops, i)));
}
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ops, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Compare.comparators, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_comparators, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Call_kind:
result = PyType_GenericNew(Call_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Call.func);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_func, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Call.args, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Call.keywords, ast2obj_keyword);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_keywords, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Num_kind:
result = PyType_GenericNew(Num_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_object(o->v.Num.n);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_n, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Str_kind:
result = PyType_GenericNew(Str_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_string(o->v.Str.s);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_s, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.Str.kind);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_kind, value) == -1)
goto failed;
Py_DECREF(value);
break;
case FormattedValue_kind:
result = PyType_GenericNew(FormattedValue_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.FormattedValue.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->v.FormattedValue.conversion);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_conversion, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.FormattedValue.format_spec);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_format_spec, value) == -1)
goto failed;
Py_DECREF(value);
break;
case JoinedStr_kind:
result = PyType_GenericNew(JoinedStr_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.JoinedStr.values, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_values, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Bytes_kind:
result = PyType_GenericNew(Bytes_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_bytes(o->v.Bytes.s);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_s, value) == -1)
goto failed;
Py_DECREF(value);
break;
case NameConstant_kind:
result = PyType_GenericNew(NameConstant_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_singleton(o->v.NameConstant.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Ellipsis_kind:
result = PyType_GenericNew(Ellipsis_type, NULL, NULL);
if (!result) goto failed;
break;
case Constant_kind:
result = PyType_GenericNew(Constant_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_constant(o->v.Constant.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Attribute_kind:
result = PyType_GenericNew(Attribute_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Attribute.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_identifier(o->v.Attribute.attr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_attr, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Attribute.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Subscript_kind:
result = PyType_GenericNew(Subscript_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Subscript.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_slice(o->v.Subscript.slice);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_slice, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Subscript.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Starred_kind:
result = PyType_GenericNew(Starred_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Starred.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Starred.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Name_kind:
result = PyType_GenericNew(Name_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.Name.id);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_id, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Name.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case List_kind:
result = PyType_GenericNew(List_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.List.elts, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elts, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.List.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Tuple_kind:
result = PyType_GenericNew(Tuple_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Tuple.elts, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_elts, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr_context(o->v.Tuple.ctx);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_ctx, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 3461 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_keyword | ast2obj_keyword( void * _o) | ['_o'] | ast2obj_keyword(void* _o)
{
keyword_ty o = (keyword_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(keyword_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_identifier(o->arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_arg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 159 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_keyword | ast2obj_keyword( void * _o) | ['_o'] | ast2obj_keyword(void* _o)
{
keyword_ty o = (keyword_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(keyword_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_identifier(o->arg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_arg, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 159 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_mod | ast2obj_mod( void * _o) | ['_o'] | ast2obj_mod(void* _o)
{
mod_ty o = (mod_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case Module_kind:
result = PyType_GenericNew(Module_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Module.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Module.type_ignores, ast2obj_type_ignore);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_ignores, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Interactive_kind:
result = PyType_GenericNew(Interactive_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Interactive.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Expression_kind:
result = PyType_GenericNew(Expression_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Expression.body);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
case FunctionType_kind:
result = PyType_GenericNew(FunctionType_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.FunctionType.argtypes, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_argtypes, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.FunctionType.returns);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_returns, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Suite_kind:
result = PyType_GenericNew(Suite_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Suite.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 506 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_mod | ast2obj_mod( void * _o) | ['_o'] | ast2obj_mod(void* _o)
{
mod_ty o = (mod_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case Module_kind:
result = PyType_GenericNew(Module_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Module.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Module.type_ignores, ast2obj_type_ignore);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_ignores, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Interactive_kind:
result = PyType_GenericNew(Interactive_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Interactive.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Expression_kind:
result = PyType_GenericNew(Expression_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Expression.body);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
case FunctionType_kind:
result = PyType_GenericNew(FunctionType_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.FunctionType.argtypes, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_argtypes, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.FunctionType.returns);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_returns, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Suite_kind:
result = PyType_GenericNew(Suite_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Suite.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 506 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_slice | ast2obj_slice( void * _o) | ['_o'] | ast2obj_slice(void* _o)
{
slice_ty o = (slice_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case Slice_kind:
result = PyType_GenericNew(Slice_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Slice.lower);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lower, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Slice.upper);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_upper, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Slice.step);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_step, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ExtSlice_kind:
result = PyType_GenericNew(ExtSlice_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.ExtSlice.dims, ast2obj_slice);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_dims, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Index_kind:
result = PyType_GenericNew(Index_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Index.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 362 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_slice | ast2obj_slice( void * _o) | ['_o'] | ast2obj_slice(void* _o)
{
slice_ty o = (slice_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case Slice_kind:
result = PyType_GenericNew(Slice_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Slice.lower);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lower, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Slice.upper);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_upper, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Slice.step);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_step, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ExtSlice_kind:
result = PyType_GenericNew(ExtSlice_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.ExtSlice.dims, ast2obj_slice);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_dims, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Index_kind:
result = PyType_GenericNew(Index_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Index.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 362 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_stmt | ast2obj_stmt( void * _o) | ['_o'] | ast2obj_stmt(void* _o)
{
stmt_ty o = (stmt_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case FunctionDef_kind:
result = PyType_GenericNew(FunctionDef_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.FunctionDef.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arguments(o->v.FunctionDef.args);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.FunctionDef.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.FunctionDef.decorator_list, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_decorator_list, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.FunctionDef.returns);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_returns, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.FunctionDef.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AsyncFunctionDef_kind:
result = PyType_GenericNew(AsyncFunctionDef_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.AsyncFunctionDef.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arguments(o->v.AsyncFunctionDef.args);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFunctionDef.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFunctionDef.decorator_list,
ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_decorator_list, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AsyncFunctionDef.returns);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_returns, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.AsyncFunctionDef.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ClassDef_kind:
result = PyType_GenericNew(ClassDef_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.ClassDef.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.bases, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_bases, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.keywords, ast2obj_keyword);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_keywords, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.decorator_list, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_decorator_list, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Return_kind:
result = PyType_GenericNew(Return_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Return.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Delete_kind:
result = PyType_GenericNew(Delete_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Delete.targets, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_targets, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Assign_kind:
result = PyType_GenericNew(Assign_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Assign.targets, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_targets, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Assign.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.Assign.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AugAssign_kind:
result = PyType_GenericNew(AugAssign_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.AugAssign.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_operator(o->v.AugAssign.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AugAssign.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AnnAssign_kind:
result = PyType_GenericNew(AnnAssign_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.AnnAssign.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AnnAssign.annotation);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_annotation, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AnnAssign.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->v.AnnAssign.simple);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_simple, value) == -1)
goto failed;
Py_DECREF(value);
break;
case For_kind:
result = PyType_GenericNew(For_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.For.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.For.iter);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_iter, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.For.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.For.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.For.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AsyncFor_kind:
result = PyType_GenericNew(AsyncFor_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.AsyncFor.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AsyncFor.iter);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_iter, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFor.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFor.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.AsyncFor.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case While_kind:
result = PyType_GenericNew(While_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.While.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.While.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.While.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
break;
case If_kind:
result = PyType_GenericNew(If_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.If.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.If.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.If.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
break;
case With_kind:
result = PyType_GenericNew(With_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.With.items, ast2obj_withitem);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_items, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.With.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.With.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AsyncWith_kind:
result = PyType_GenericNew(AsyncWith_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.AsyncWith.items, ast2obj_withitem);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_items, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncWith.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.AsyncWith.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Raise_kind:
result = PyType_GenericNew(Raise_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Raise.exc);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_exc, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Raise.cause);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_cause, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Try_kind:
result = PyType_GenericNew(Try_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Try.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Try.handlers, ast2obj_excepthandler);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_handlers, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Try.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Try.finalbody, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_finalbody, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Assert_kind:
result = PyType_GenericNew(Assert_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Assert.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Assert.msg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_msg, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Import_kind:
result = PyType_GenericNew(Import_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Import.names, ast2obj_alias);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ImportFrom_kind:
result = PyType_GenericNew(ImportFrom_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.ImportFrom.module);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_module, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ImportFrom.names, ast2obj_alias);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->v.ImportFrom.level);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_level, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Global_kind:
result = PyType_GenericNew(Global_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Global.names, ast2obj_identifier);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Nonlocal_kind:
result = PyType_GenericNew(Nonlocal_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Nonlocal.names, ast2obj_identifier);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Expr_kind:
result = PyType_GenericNew(Expr_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Expr.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Pass_kind:
result = PyType_GenericNew(Pass_type, NULL, NULL);
if (!result) goto failed;
break;
case Break_kind:
result = PyType_GenericNew(Break_type, NULL, NULL);
if (!result) goto failed;
break;
case Continue_kind:
result = PyType_GenericNew(Continue_type, NULL, NULL);
if (!result) goto failed;
break;
}
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 3710 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_stmt | ast2obj_stmt( void * _o) | ['_o'] | ast2obj_stmt(void* _o)
{
stmt_ty o = (stmt_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case FunctionDef_kind:
result = PyType_GenericNew(FunctionDef_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.FunctionDef.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arguments(o->v.FunctionDef.args);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.FunctionDef.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.FunctionDef.decorator_list, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_decorator_list, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.FunctionDef.returns);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_returns, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.FunctionDef.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AsyncFunctionDef_kind:
result = PyType_GenericNew(AsyncFunctionDef_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.AsyncFunctionDef.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_arguments(o->v.AsyncFunctionDef.args);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_args, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFunctionDef.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFunctionDef.decorator_list,
ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_decorator_list, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AsyncFunctionDef.returns);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_returns, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.AsyncFunctionDef.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ClassDef_kind:
result = PyType_GenericNew(ClassDef_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.ClassDef.name);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_name, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.bases, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_bases, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.keywords, ast2obj_keyword);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_keywords, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ClassDef.decorator_list, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_decorator_list, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Return_kind:
result = PyType_GenericNew(Return_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Return.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Delete_kind:
result = PyType_GenericNew(Delete_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Delete.targets, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_targets, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Assign_kind:
result = PyType_GenericNew(Assign_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Assign.targets, ast2obj_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_targets, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Assign.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.Assign.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AugAssign_kind:
result = PyType_GenericNew(AugAssign_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.AugAssign.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_operator(o->v.AugAssign.op);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_op, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AugAssign.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AnnAssign_kind:
result = PyType_GenericNew(AnnAssign_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.AnnAssign.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AnnAssign.annotation);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_annotation, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AnnAssign.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->v.AnnAssign.simple);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_simple, value) == -1)
goto failed;
Py_DECREF(value);
break;
case For_kind:
result = PyType_GenericNew(For_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.For.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.For.iter);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_iter, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.For.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.For.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.For.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AsyncFor_kind:
result = PyType_GenericNew(AsyncFor_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.AsyncFor.target);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_target, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.AsyncFor.iter);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_iter, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFor.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncFor.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.AsyncFor.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case While_kind:
result = PyType_GenericNew(While_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.While.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.While.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.While.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
break;
case If_kind:
result = PyType_GenericNew(If_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.If.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.If.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.If.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
break;
case With_kind:
result = PyType_GenericNew(With_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.With.items, ast2obj_withitem);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_items, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.With.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.With.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case AsyncWith_kind:
result = PyType_GenericNew(AsyncWith_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.AsyncWith.items, ast2obj_withitem);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_items, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.AsyncWith.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_string(o->v.AsyncWith.type_comment);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_type_comment, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Raise_kind:
result = PyType_GenericNew(Raise_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Raise.exc);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_exc, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Raise.cause);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_cause, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Try_kind:
result = PyType_GenericNew(Try_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Try.body, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_body, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Try.handlers, ast2obj_excepthandler);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_handlers, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Try.orelse, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_orelse, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.Try.finalbody, ast2obj_stmt);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_finalbody, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Assert_kind:
result = PyType_GenericNew(Assert_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Assert.test);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_test, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->v.Assert.msg);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_msg, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Import_kind:
result = PyType_GenericNew(Import_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Import.names, ast2obj_alias);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
break;
case ImportFrom_kind:
result = PyType_GenericNew(ImportFrom_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_identifier(o->v.ImportFrom.module);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_module, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_list(o->v.ImportFrom.names, ast2obj_alias);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->v.ImportFrom.level);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_level, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Global_kind:
result = PyType_GenericNew(Global_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Global.names, ast2obj_identifier);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Nonlocal_kind:
result = PyType_GenericNew(Nonlocal_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_list(o->v.Nonlocal.names, ast2obj_identifier);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_names, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Expr_kind:
result = PyType_GenericNew(Expr_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_expr(o->v.Expr.value);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_value, value) == -1)
goto failed;
Py_DECREF(value);
break;
case Pass_kind:
result = PyType_GenericNew(Pass_type, NULL, NULL);
if (!result) goto failed;
break;
case Break_kind:
result = PyType_GenericNew(Break_type, NULL, NULL);
if (!result) goto failed;
break;
case Continue_kind:
result = PyType_GenericNew(Continue_type, NULL, NULL);
if (!result) goto failed;
break;
}
value = ast2obj_int(o->lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) < 0)
goto failed;
Py_DECREF(value);
value = ast2obj_int(o->col_offset);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_col_offset, value) < 0)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 3710 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_type_ignore | ast2obj_type_ignore( void * _o) | ['_o'] | ast2obj_type_ignore(void* _o)
{
type_ignore_ty o = (type_ignore_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case TypeIgnore_kind:
result = PyType_GenericNew(TypeIgnore_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_int(o->v.TypeIgnore.lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 136 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_type_ignore | ast2obj_type_ignore( void * _o) | ['_o'] | ast2obj_type_ignore(void* _o)
{
type_ignore_ty o = (type_ignore_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
switch (o->kind) {
case TypeIgnore_kind:
result = PyType_GenericNew(TypeIgnore_type, NULL, NULL);
if (!result) goto failed;
value = ast2obj_int(o->v.TypeIgnore.lineno);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_lineno, value) == -1)
goto failed;
Py_DECREF(value);
break;
}
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 136 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_withitem | ast2obj_withitem( void * _o) | ['_o'] | ast2obj_withitem(void* _o)
{
withitem_ty o = (withitem_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(withitem_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_expr(o->context_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_context_expr, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->optional_vars);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_optional_vars, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 159 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast2obj_withitem | ast2obj_withitem( void * _o) | ['_o'] | ast2obj_withitem(void* _o)
{
withitem_ty o = (withitem_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
Py_INCREF(Py_None);
return Py_None;
}
result = PyType_GenericNew(withitem_type, NULL, NULL);
if (!result) return NULL;
value = ast2obj_expr(o->context_expr);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_context_expr, value) == -1)
goto failed;
Py_DECREF(value);
value = ast2obj_expr(o->optional_vars);
if (!value) goto failed;
if (_PyObject_SetAttrId(result, &PyId_optional_vars, value) == -1)
goto failed;
Py_DECREF(value);
return result;
failed:
Py_XDECREF(value);
Py_XDECREF(result);
return NULL;
} | 159 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_type_init | ast_type_init( PyObject * self , PyObject * args , PyObject * kw) | ['self', 'args', 'kw'] | ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
{
_Py_IDENTIFIER(_fields);
Py_ssize_t i, numfields = 0;
int res = -1;
PyObject *key, *value, *fields;
fields = _PyObject_GetAttrId((PyObject*)Py_TYPE(self), &PyId__fields);
if (!fields)
PyErr_Clear();
if (fields) {
numfields = PySequence_Size(fields);
if (numfields == -1)
goto cleanup;
}
res = 0; /* if no error occurs, this stays 0 to the end */
if (PyTuple_GET_SIZE(args) > 0) {
if (numfields != PyTuple_GET_SIZE(args)) {
PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s"
"%zd positional argument%s",
Py_TYPE(self)->tp_name,
numfields == 0 ? "" : "either 0 or ",
numfields, numfields == 1 ? "" : "s");
res = -1;
goto cleanup;
}
for (i = 0; i < PyTuple_GET_SIZE(args); i++) {
/* cannot be reached when fields is NULL */
PyObject *name = PySequence_GetItem(fields, i);
if (!name) {
res = -1;
goto cleanup;
}
res = PyObject_SetAttr(self, name, PyTuple_GET_ITEM(args, i));
Py_DECREF(name);
if (res < 0)
goto cleanup;
}
}
if (kw) {
i = 0; /* needed by PyDict_Next */
while (PyDict_Next(kw, &i, &key, &value)) {
res = PyObject_SetAttr(self, key, value);
if (res < 0)
goto cleanup;
}
}
cleanup:
Py_XDECREF(fields);
return res;
} | 292 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_type_init | ast_type_init( PyObject * self , PyObject * args , PyObject * kw) | ['self', 'args', 'kw'] | ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
{
_Py_IDENTIFIER(_fields);
Py_ssize_t i, numfields = 0;
int res = -1;
PyObject *key, *value, *fields;
fields = _PyObject_GetAttrId((PyObject*)Py_TYPE(self), &PyId__fields);
if (!fields)
PyErr_Clear();
if (fields) {
numfields = PySequence_Size(fields);
if (numfields == -1)
goto cleanup;
}
res = 0; /* if no error occurs, this stays 0 to the end */
if (PyTuple_GET_SIZE(args) > 0) {
if (numfields != PyTuple_GET_SIZE(args)) {
PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s"
"%zd positional argument%s",
Py_TYPE(self)->tp_name,
numfields == 0 ? "" : "either 0 or ",
numfields, numfields == 1 ? "" : "s");
res = -1;
goto cleanup;
}
for (i = 0; i < PyTuple_GET_SIZE(args); i++) {
/* cannot be reached when fields is NULL */
PyObject *name = PySequence_GetItem(fields, i);
if (!name) {
res = -1;
goto cleanup;
}
res = PyObject_SetAttr(self, name, PyTuple_GET_ITEM(args, i));
Py_DECREF(name);
if (res < 0)
goto cleanup;
}
}
if (kw) {
i = 0; /* needed by PyDict_Next */
while (PyDict_Next(kw, &i, &key, &value)) {
res = PyObject_SetAttr(self, key, value);
if (res < 0)
goto cleanup;
}
}
cleanup:
Py_XDECREF(fields);
return res;
} | 292 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_type_reduce | ast_type_reduce( PyObject * self , PyObject * unused) | ['self', 'unused'] | ast_type_reduce(PyObject *self, PyObject *unused)
{
PyObject *res;
_Py_IDENTIFIER(__dict__);
PyObject *dict = _PyObject_GetAttrId(self, &PyId___dict__);
if (dict == NULL) {
if (PyErr_ExceptionMatches(PyExc_AttributeError))
PyErr_Clear();
else
return NULL;
}
if (dict) {
res = Py_BuildValue("O()O", Py_TYPE(self), dict);
Py_DECREF(dict);
return res;
}
return Py_BuildValue("O()", Py_TYPE(self));
} | 95 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_type_reduce | ast_type_reduce( PyObject * self , PyObject * unused) | ['self', 'unused'] | ast_type_reduce(PyObject *self, PyObject *unused)
{
PyObject *res;
_Py_IDENTIFIER(__dict__);
PyObject *dict = _PyObject_GetAttrId(self, &PyId___dict__);
if (dict == NULL) {
if (PyErr_ExceptionMatches(PyExc_AttributeError))
PyErr_Clear();
else
return NULL;
}
if (dict) {
res = Py_BuildValue("O()O", Py_TYPE(self), dict);
Py_DECREF(dict);
return res;
}
return Py_BuildValue("O()", Py_TYPE(self));
} | 95 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | exists_not_none | exists_not_none( PyObject * obj , _Py_Identifier * id) | ['obj', 'id'] | static int exists_not_none(PyObject *obj, _Py_Identifier *id)
{
int isnone;
PyObject *attr = _PyObject_GetAttrId(obj, id);
if (!attr) {
PyErr_Clear();
return 0;
}
isnone = attr == Py_None;
Py_DECREF(attr);
return !isnone;
} | 55 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | exists_not_none | exists_not_none( PyObject * obj , _Py_Identifier * id) | ['obj', 'id'] | static int exists_not_none(PyObject *obj, _Py_Identifier *id)
{
int isnone;
PyObject *attr = _PyObject_GetAttrId(obj, id);
if (!attr) {
PyErr_Clear();
return 0;
}
isnone = attr == Py_None;
Py_DECREF(attr);
return !isnone;
} | 55 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | make_type | make_type( char * type , PyTypeObject * base , char ** fields , int num_fields) | ['type', 'base', 'fields', 'num_fields'] | static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int num_fields)
{
PyObject *fnames, *result;
int i;
fnames = PyTuple_New(num_fields);
if (!fnames) return NULL;
for (i = 0; i < num_fields; i++) {
PyObject *field = PyUnicode_FromString(fields[i]);
if (!field) {
Py_DECREF(fnames);
return NULL;
}
PyTuple_SET_ITEM(fnames, i, field);
}
result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
type, base, "_fields", fnames, "__module__", "_ast3");
Py_DECREF(fnames);
return (PyTypeObject*)result;
} | 133 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | make_type | make_type( char * type , PyTypeObject * base , char ** fields , int num_fields) | ['type', 'base', 'fields', 'num_fields'] | static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int num_fields)
{
PyObject *fnames, *result;
int i;
fnames = PyTuple_New(num_fields);
if (!fnames) return NULL;
for (i = 0; i < num_fields; i++) {
PyObject *field = PyUnicode_FromString(fields[i]);
if (!field) {
Py_DECREF(fnames);
return NULL;
}
PyTuple_SET_ITEM(fnames, i, field);
}
result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
type, base, "_fields", fnames, "__module__", "_ast3");
Py_DECREF(fnames);
return (PyTypeObject*)result;
} | 133 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_alias | obj2ast_alias( PyObject * obj , alias_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
identifier name;
identifier asname;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from alias");
return 1;
}
if (exists_not_none(obj, &PyId_asname)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_asname);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &asname, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
asname = NULL;
}
*out = alias(name, asname, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 193 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_alias | obj2ast_alias( PyObject * obj , alias_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
identifier name;
identifier asname;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from alias");
return 1;
}
if (exists_not_none(obj, &PyId_asname)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_asname);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &asname, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
asname = NULL;
}
*out = alias(name, asname, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 193 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_arg | obj2ast_arg( PyObject * obj , arg_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
identifier arg;
expr_ty annotation;
string type_comment;
int lineno;
int col_offset;
if (_PyObject_HasAttrId(obj, &PyId_arg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_arg);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &arg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"arg\" missing from arg");
return 1;
}
if (exists_not_none(obj, &PyId_annotation)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_annotation);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &annotation, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
annotation = NULL;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from arg");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from arg");
return 1;
}
*out = arg(arg, annotation, type_comment, lineno, col_offset, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 421 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_arg | obj2ast_arg( PyObject * obj , arg_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
identifier arg;
expr_ty annotation;
string type_comment;
int lineno;
int col_offset;
if (_PyObject_HasAttrId(obj, &PyId_arg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_arg);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &arg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"arg\" missing from arg");
return 1;
}
if (exists_not_none(obj, &PyId_annotation)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_annotation);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &annotation, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
annotation = NULL;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from arg");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from arg");
return 1;
}
*out = arg(arg, annotation, type_comment, lineno, col_offset, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 421 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_arguments | obj2ast_arguments( PyObject * obj , arguments_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
asdl_seq* args;
arg_ty vararg;
asdl_seq* kwonlyargs;
asdl_seq* kw_defaults;
arg_ty kwarg;
asdl_seq* defaults;
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"args\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
args = _Ta3_asdl_seq_new(len, arena);
if (args == NULL) goto failed;
for (i = 0; i < len; i++) {
arg_ty value;
res = obj2ast_arg(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"args\" changed size during iteration");
goto failed;
}
asdl_seq_SET(args, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from arguments");
return 1;
}
if (exists_not_none(obj, &PyId_vararg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_vararg);
if (tmp == NULL) goto failed;
res = obj2ast_arg(tmp, &vararg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
vararg = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_kwonlyargs)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_kwonlyargs);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"kwonlyargs\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
kwonlyargs = _Ta3_asdl_seq_new(len, arena);
if (kwonlyargs == NULL) goto failed;
for (i = 0; i < len; i++) {
arg_ty value;
res = obj2ast_arg(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"kwonlyargs\" changed size during iteration");
goto failed;
}
asdl_seq_SET(kwonlyargs, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"kwonlyargs\" missing from arguments");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_kw_defaults)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_kw_defaults);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"kw_defaults\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
kw_defaults = _Ta3_asdl_seq_new(len, arena);
if (kw_defaults == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"kw_defaults\" changed size during iteration");
goto failed;
}
asdl_seq_SET(kw_defaults, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"kw_defaults\" missing from arguments");
return 1;
}
if (exists_not_none(obj, &PyId_kwarg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_kwarg);
if (tmp == NULL) goto failed;
res = obj2ast_arg(tmp, &kwarg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
kwarg = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_defaults)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_defaults);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"defaults\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
defaults = _Ta3_asdl_seq_new(len, arena);
if (defaults == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"defaults\" changed size during iteration");
goto failed;
}
asdl_seq_SET(defaults, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"defaults\" missing from arguments");
return 1;
}
*out = arguments(args, vararg, kwonlyargs, kw_defaults, kwarg, defaults,
arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 943 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_arguments | obj2ast_arguments( PyObject * obj , arguments_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
asdl_seq* args;
arg_ty vararg;
asdl_seq* kwonlyargs;
asdl_seq* kw_defaults;
arg_ty kwarg;
asdl_seq* defaults;
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"args\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
args = _Ta3_asdl_seq_new(len, arena);
if (args == NULL) goto failed;
for (i = 0; i < len; i++) {
arg_ty value;
res = obj2ast_arg(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"args\" changed size during iteration");
goto failed;
}
asdl_seq_SET(args, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from arguments");
return 1;
}
if (exists_not_none(obj, &PyId_vararg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_vararg);
if (tmp == NULL) goto failed;
res = obj2ast_arg(tmp, &vararg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
vararg = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_kwonlyargs)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_kwonlyargs);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"kwonlyargs\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
kwonlyargs = _Ta3_asdl_seq_new(len, arena);
if (kwonlyargs == NULL) goto failed;
for (i = 0; i < len; i++) {
arg_ty value;
res = obj2ast_arg(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"kwonlyargs\" changed size during iteration");
goto failed;
}
asdl_seq_SET(kwonlyargs, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"kwonlyargs\" missing from arguments");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_kw_defaults)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_kw_defaults);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"kw_defaults\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
kw_defaults = _Ta3_asdl_seq_new(len, arena);
if (kw_defaults == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"kw_defaults\" changed size during iteration");
goto failed;
}
asdl_seq_SET(kw_defaults, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"kw_defaults\" missing from arguments");
return 1;
}
if (exists_not_none(obj, &PyId_kwarg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_kwarg);
if (tmp == NULL) goto failed;
res = obj2ast_arg(tmp, &kwarg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
kwarg = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_defaults)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_defaults);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "arguments field \"defaults\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
defaults = _Ta3_asdl_seq_new(len, arena);
if (defaults == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "arguments field \"defaults\" changed size during iteration");
goto failed;
}
asdl_seq_SET(defaults, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"defaults\" missing from arguments");
return 1;
}
*out = arguments(args, vararg, kwonlyargs, kw_defaults, kwarg, defaults,
arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 943 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_comprehension | obj2ast_comprehension( PyObject * obj , comprehension_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
expr_ty target;
expr_ty iter;
asdl_seq* ifs;
int is_async;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from comprehension");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_iter)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_iter);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &iter, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"iter\" missing from comprehension");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ifs)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_ifs);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "comprehension field \"ifs\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
ifs = _Ta3_asdl_seq_new(len, arena);
if (ifs == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "comprehension field \"ifs\" changed size during iteration");
goto failed;
}
asdl_seq_SET(ifs, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ifs\" missing from comprehension");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_is_async)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_is_async);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &is_async, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"is_async\" missing from comprehension");
return 1;
}
*out = comprehension(target, iter, ifs, is_async, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 466 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_comprehension | obj2ast_comprehension( PyObject * obj , comprehension_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
expr_ty target;
expr_ty iter;
asdl_seq* ifs;
int is_async;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from comprehension");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_iter)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_iter);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &iter, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"iter\" missing from comprehension");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ifs)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_ifs);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "comprehension field \"ifs\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
ifs = _Ta3_asdl_seq_new(len, arena);
if (ifs == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "comprehension field \"ifs\" changed size during iteration");
goto failed;
}
asdl_seq_SET(ifs, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ifs\" missing from comprehension");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_is_async)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_is_async);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &is_async, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"is_async\" missing from comprehension");
return 1;
}
*out = comprehension(target, iter, ifs, is_async, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 466 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_excepthandler | obj2ast_excepthandler( PyObject * obj , excepthandler_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
int lineno;
int col_offset;
if (obj == Py_None) {
*out = NULL;
return 0;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from excepthandler");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from excepthandler");
return 1;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ExceptHandler_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty type;
identifier name;
asdl_seq* body;
if (exists_not_none(obj, &PyId_type)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &type, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type = NULL;
}
if (exists_not_none(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
name = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ExceptHandler field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ExceptHandler field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from ExceptHandler");
return 1;
}
*out = ExceptHandler(type, name, body, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of excepthandler, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 601 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_excepthandler | obj2ast_excepthandler( PyObject * obj , excepthandler_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
int lineno;
int col_offset;
if (obj == Py_None) {
*out = NULL;
return 0;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from excepthandler");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from excepthandler");
return 1;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ExceptHandler_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty type;
identifier name;
asdl_seq* body;
if (exists_not_none(obj, &PyId_type)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &type, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type = NULL;
}
if (exists_not_none(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
name = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ExceptHandler field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ExceptHandler field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from ExceptHandler");
return 1;
}
*out = ExceptHandler(type, name, body, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of excepthandler, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 601 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_expr | obj2ast_expr( PyObject * obj , expr_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
int lineno;
int col_offset;
if (obj == Py_None) {
*out = NULL;
return 0;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from expr");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from expr");
return 1;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)BoolOp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
boolop_ty op;
asdl_seq* values;
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_boolop(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from BoolOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_values)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_values);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "BoolOp field \"values\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
values = _Ta3_asdl_seq_new(len, arena);
if (values == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "BoolOp field \"values\" changed size during iteration");
goto failed;
}
asdl_seq_SET(values, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"values\" missing from BoolOp");
return 1;
}
*out = BoolOp(op, values, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)BinOp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty left;
operator_ty op;
expr_ty right;
if (_PyObject_HasAttrId(obj, &PyId_left)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_left);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &left, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"left\" missing from BinOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_operator(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from BinOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_right)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_right);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &right, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"right\" missing from BinOp");
return 1;
}
*out = BinOp(left, op, right, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)UnaryOp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
unaryop_ty op;
expr_ty operand;
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_unaryop(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from UnaryOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_operand)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_operand);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &operand, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"operand\" missing from UnaryOp");
return 1;
}
*out = UnaryOp(op, operand, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Lambda_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
arguments_ty args;
expr_ty body;
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
res = obj2ast_arguments(tmp, &args, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from Lambda");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &body, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Lambda");
return 1;
}
*out = Lambda(args, body, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)IfExp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
expr_ty body;
expr_ty orelse;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from IfExp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &body, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from IfExp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &orelse, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from IfExp");
return 1;
}
*out = IfExp(test, body, orelse, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Dict_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* keys;
asdl_seq* values;
if (_PyObject_HasAttrId(obj, &PyId_keys)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_keys);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Dict field \"keys\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
keys = _Ta3_asdl_seq_new(len, arena);
if (keys == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Dict field \"keys\" changed size during iteration");
goto failed;
}
asdl_seq_SET(keys, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"keys\" missing from Dict");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_values)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_values);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Dict field \"values\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
values = _Ta3_asdl_seq_new(len, arena);
if (values == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Dict field \"values\" changed size during iteration");
goto failed;
}
asdl_seq_SET(values, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"values\" missing from Dict");
return 1;
}
*out = Dict(keys, values, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Set_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* elts;
if (_PyObject_HasAttrId(obj, &PyId_elts)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_elts);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Set field \"elts\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
elts = _Ta3_asdl_seq_new(len, arena);
if (elts == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Set field \"elts\" changed size during iteration");
goto failed;
}
asdl_seq_SET(elts, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elts\" missing from Set");
return 1;
}
*out = Set(elts, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ListComp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty elt;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_elt)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_elt);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &elt, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elt\" missing from ListComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ListComp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ListComp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from ListComp");
return 1;
}
*out = ListComp(elt, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)SetComp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty elt;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_elt)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_elt);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &elt, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elt\" missing from SetComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "SetComp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "SetComp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from SetComp");
return 1;
}
*out = SetComp(elt, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)DictComp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty key;
expr_ty value;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_key)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_key);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &key, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"key\" missing from DictComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from DictComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "DictComp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "DictComp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from DictComp");
return 1;
}
*out = DictComp(key, value, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)GeneratorExp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty elt;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_elt)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_elt);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &elt, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elt\" missing from GeneratorExp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "GeneratorExp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "GeneratorExp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from GeneratorExp");
return 1;
}
*out = GeneratorExp(elt, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Await_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Await");
return 1;
}
*out = Await(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Yield_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (exists_not_none(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
value = NULL;
}
*out = Yield(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)YieldFrom_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from YieldFrom");
return 1;
}
*out = YieldFrom(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Compare_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty left;
asdl_int_seq* ops;
asdl_seq* comparators;
if (_PyObject_HasAttrId(obj, &PyId_left)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_left);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &left, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"left\" missing from Compare");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ops)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_ops);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Compare field \"ops\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
ops = _Ta3_asdl_int_seq_new(len, arena);
if (ops == NULL) goto failed;
for (i = 0; i < len; i++) {
cmpop_ty value;
res = obj2ast_cmpop(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Compare field \"ops\" changed size during iteration");
goto failed;
}
asdl_seq_SET(ops, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ops\" missing from Compare");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_comparators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_comparators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Compare field \"comparators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
comparators = _Ta3_asdl_seq_new(len, arena);
if (comparators == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Compare field \"comparators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(comparators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"comparators\" missing from Compare");
return 1;
}
*out = Compare(left, ops, comparators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Call_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty func;
asdl_seq* args;
asdl_seq* keywords;
if (_PyObject_HasAttrId(obj, &PyId_func)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_func);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &func, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"func\" missing from Call");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Call field \"args\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
args = _Ta3_asdl_seq_new(len, arena);
if (args == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Call field \"args\" changed size during iteration");
goto failed;
}
asdl_seq_SET(args, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from Call");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_keywords)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_keywords);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Call field \"keywords\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
keywords = _Ta3_asdl_seq_new(len, arena);
if (keywords == NULL) goto failed;
for (i = 0; i < len; i++) {
keyword_ty value;
res = obj2ast_keyword(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Call field \"keywords\" changed size during iteration");
goto failed;
}
asdl_seq_SET(keywords, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"keywords\" missing from Call");
return 1;
}
*out = Call(func, args, keywords, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Num_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
object n;
if (_PyObject_HasAttrId(obj, &PyId_n)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_n);
if (tmp == NULL) goto failed;
res = obj2ast_object(tmp, &n, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"n\" missing from Num");
return 1;
}
*out = Num(n, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Str_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
string s;
string kind;
if (_PyObject_HasAttrId(obj, &PyId_s)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_s);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &s, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"s\" missing from Str");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_kind)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_kind);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &kind, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"kind\" missing from Str");
return 1;
}
*out = Str(s, kind, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)FormattedValue_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
int conversion;
expr_ty format_spec;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from FormattedValue");
return 1;
}
if (exists_not_none(obj, &PyId_conversion)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_conversion);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &conversion, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
conversion = 0;
}
if (exists_not_none(obj, &PyId_format_spec)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_format_spec);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &format_spec, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
format_spec = NULL;
}
*out = FormattedValue(value, conversion, format_spec, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)JoinedStr_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* values;
if (_PyObject_HasAttrId(obj, &PyId_values)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_values);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "JoinedStr field \"values\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
values = _Ta3_asdl_seq_new(len, arena);
if (values == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "JoinedStr field \"values\" changed size during iteration");
goto failed;
}
asdl_seq_SET(values, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"values\" missing from JoinedStr");
return 1;
}
*out = JoinedStr(values, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Bytes_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
bytes s;
if (_PyObject_HasAttrId(obj, &PyId_s)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_s);
if (tmp == NULL) goto failed;
res = obj2ast_bytes(tmp, &s, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"s\" missing from Bytes");
return 1;
}
*out = Bytes(s, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)NameConstant_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
singleton value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_singleton(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from NameConstant");
return 1;
}
*out = NameConstant(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Ellipsis_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Ellipsis(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Constant_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
constant value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_constant(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Constant");
return 1;
}
*out = Constant(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Attribute_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
identifier attr;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Attribute");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_attr)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_attr);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &attr, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"attr\" missing from Attribute");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Attribute");
return 1;
}
*out = Attribute(value, attr, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Subscript_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
slice_ty slice;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Subscript");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_slice)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_slice);
if (tmp == NULL) goto failed;
res = obj2ast_slice(tmp, &slice, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"slice\" missing from Subscript");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Subscript");
return 1;
}
*out = Subscript(value, slice, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Starred_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Starred");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Starred");
return 1;
}
*out = Starred(value, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Name_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier id;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_id)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_id);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &id, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"id\" missing from Name");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Name");
return 1;
}
*out = Name(id, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)List_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* elts;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_elts)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_elts);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "List field \"elts\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
elts = _Ta3_asdl_seq_new(len, arena);
if (elts == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "List field \"elts\" changed size during iteration");
goto failed;
}
asdl_seq_SET(elts, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elts\" missing from List");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from List");
return 1;
}
*out = List(elts, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Tuple_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* elts;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_elts)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_elts);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Tuple field \"elts\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
elts = _Ta3_asdl_seq_new(len, arena);
if (elts == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Tuple field \"elts\" changed size during iteration");
goto failed;
}
asdl_seq_SET(elts, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elts\" missing from Tuple");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Tuple");
return 1;
}
*out = Tuple(elts, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of expr, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 7985 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_expr | obj2ast_expr( PyObject * obj , expr_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
int lineno;
int col_offset;
if (obj == Py_None) {
*out = NULL;
return 0;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from expr");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from expr");
return 1;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)BoolOp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
boolop_ty op;
asdl_seq* values;
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_boolop(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from BoolOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_values)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_values);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "BoolOp field \"values\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
values = _Ta3_asdl_seq_new(len, arena);
if (values == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "BoolOp field \"values\" changed size during iteration");
goto failed;
}
asdl_seq_SET(values, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"values\" missing from BoolOp");
return 1;
}
*out = BoolOp(op, values, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)BinOp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty left;
operator_ty op;
expr_ty right;
if (_PyObject_HasAttrId(obj, &PyId_left)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_left);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &left, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"left\" missing from BinOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_operator(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from BinOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_right)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_right);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &right, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"right\" missing from BinOp");
return 1;
}
*out = BinOp(left, op, right, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)UnaryOp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
unaryop_ty op;
expr_ty operand;
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_unaryop(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from UnaryOp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_operand)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_operand);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &operand, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"operand\" missing from UnaryOp");
return 1;
}
*out = UnaryOp(op, operand, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Lambda_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
arguments_ty args;
expr_ty body;
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
res = obj2ast_arguments(tmp, &args, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from Lambda");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &body, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Lambda");
return 1;
}
*out = Lambda(args, body, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)IfExp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
expr_ty body;
expr_ty orelse;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from IfExp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &body, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from IfExp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &orelse, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from IfExp");
return 1;
}
*out = IfExp(test, body, orelse, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Dict_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* keys;
asdl_seq* values;
if (_PyObject_HasAttrId(obj, &PyId_keys)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_keys);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Dict field \"keys\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
keys = _Ta3_asdl_seq_new(len, arena);
if (keys == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Dict field \"keys\" changed size during iteration");
goto failed;
}
asdl_seq_SET(keys, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"keys\" missing from Dict");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_values)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_values);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Dict field \"values\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
values = _Ta3_asdl_seq_new(len, arena);
if (values == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Dict field \"values\" changed size during iteration");
goto failed;
}
asdl_seq_SET(values, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"values\" missing from Dict");
return 1;
}
*out = Dict(keys, values, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Set_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* elts;
if (_PyObject_HasAttrId(obj, &PyId_elts)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_elts);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Set field \"elts\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
elts = _Ta3_asdl_seq_new(len, arena);
if (elts == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Set field \"elts\" changed size during iteration");
goto failed;
}
asdl_seq_SET(elts, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elts\" missing from Set");
return 1;
}
*out = Set(elts, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ListComp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty elt;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_elt)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_elt);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &elt, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elt\" missing from ListComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ListComp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ListComp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from ListComp");
return 1;
}
*out = ListComp(elt, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)SetComp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty elt;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_elt)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_elt);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &elt, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elt\" missing from SetComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "SetComp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "SetComp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from SetComp");
return 1;
}
*out = SetComp(elt, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)DictComp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty key;
expr_ty value;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_key)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_key);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &key, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"key\" missing from DictComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from DictComp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "DictComp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "DictComp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from DictComp");
return 1;
}
*out = DictComp(key, value, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)GeneratorExp_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty elt;
asdl_seq* generators;
if (_PyObject_HasAttrId(obj, &PyId_elt)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_elt);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &elt, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elt\" missing from GeneratorExp");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_generators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_generators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "GeneratorExp field \"generators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
generators = _Ta3_asdl_seq_new(len, arena);
if (generators == NULL) goto failed;
for (i = 0; i < len; i++) {
comprehension_ty value;
res = obj2ast_comprehension(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "GeneratorExp field \"generators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(generators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"generators\" missing from GeneratorExp");
return 1;
}
*out = GeneratorExp(elt, generators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Await_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Await");
return 1;
}
*out = Await(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Yield_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (exists_not_none(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
value = NULL;
}
*out = Yield(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)YieldFrom_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from YieldFrom");
return 1;
}
*out = YieldFrom(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Compare_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty left;
asdl_int_seq* ops;
asdl_seq* comparators;
if (_PyObject_HasAttrId(obj, &PyId_left)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_left);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &left, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"left\" missing from Compare");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ops)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_ops);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Compare field \"ops\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
ops = _Ta3_asdl_int_seq_new(len, arena);
if (ops == NULL) goto failed;
for (i = 0; i < len; i++) {
cmpop_ty value;
res = obj2ast_cmpop(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Compare field \"ops\" changed size during iteration");
goto failed;
}
asdl_seq_SET(ops, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ops\" missing from Compare");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_comparators)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_comparators);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Compare field \"comparators\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
comparators = _Ta3_asdl_seq_new(len, arena);
if (comparators == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Compare field \"comparators\" changed size during iteration");
goto failed;
}
asdl_seq_SET(comparators, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"comparators\" missing from Compare");
return 1;
}
*out = Compare(left, ops, comparators, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Call_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty func;
asdl_seq* args;
asdl_seq* keywords;
if (_PyObject_HasAttrId(obj, &PyId_func)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_func);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &func, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"func\" missing from Call");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Call field \"args\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
args = _Ta3_asdl_seq_new(len, arena);
if (args == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Call field \"args\" changed size during iteration");
goto failed;
}
asdl_seq_SET(args, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from Call");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_keywords)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_keywords);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Call field \"keywords\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
keywords = _Ta3_asdl_seq_new(len, arena);
if (keywords == NULL) goto failed;
for (i = 0; i < len; i++) {
keyword_ty value;
res = obj2ast_keyword(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Call field \"keywords\" changed size during iteration");
goto failed;
}
asdl_seq_SET(keywords, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"keywords\" missing from Call");
return 1;
}
*out = Call(func, args, keywords, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Num_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
object n;
if (_PyObject_HasAttrId(obj, &PyId_n)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_n);
if (tmp == NULL) goto failed;
res = obj2ast_object(tmp, &n, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"n\" missing from Num");
return 1;
}
*out = Num(n, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Str_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
string s;
string kind;
if (_PyObject_HasAttrId(obj, &PyId_s)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_s);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &s, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"s\" missing from Str");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_kind)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_kind);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &kind, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"kind\" missing from Str");
return 1;
}
*out = Str(s, kind, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)FormattedValue_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
int conversion;
expr_ty format_spec;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from FormattedValue");
return 1;
}
if (exists_not_none(obj, &PyId_conversion)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_conversion);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &conversion, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
conversion = 0;
}
if (exists_not_none(obj, &PyId_format_spec)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_format_spec);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &format_spec, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
format_spec = NULL;
}
*out = FormattedValue(value, conversion, format_spec, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)JoinedStr_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* values;
if (_PyObject_HasAttrId(obj, &PyId_values)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_values);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "JoinedStr field \"values\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
values = _Ta3_asdl_seq_new(len, arena);
if (values == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "JoinedStr field \"values\" changed size during iteration");
goto failed;
}
asdl_seq_SET(values, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"values\" missing from JoinedStr");
return 1;
}
*out = JoinedStr(values, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Bytes_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
bytes s;
if (_PyObject_HasAttrId(obj, &PyId_s)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_s);
if (tmp == NULL) goto failed;
res = obj2ast_bytes(tmp, &s, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"s\" missing from Bytes");
return 1;
}
*out = Bytes(s, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)NameConstant_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
singleton value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_singleton(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from NameConstant");
return 1;
}
*out = NameConstant(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Ellipsis_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Ellipsis(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Constant_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
constant value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_constant(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Constant");
return 1;
}
*out = Constant(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Attribute_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
identifier attr;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Attribute");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_attr)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_attr);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &attr, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"attr\" missing from Attribute");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Attribute");
return 1;
}
*out = Attribute(value, attr, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Subscript_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
slice_ty slice;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Subscript");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_slice)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_slice);
if (tmp == NULL) goto failed;
res = obj2ast_slice(tmp, &slice, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"slice\" missing from Subscript");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Subscript");
return 1;
}
*out = Subscript(value, slice, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Starred_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Starred");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Starred");
return 1;
}
*out = Starred(value, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Name_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier id;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_id)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_id);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &id, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"id\" missing from Name");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Name");
return 1;
}
*out = Name(id, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)List_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* elts;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_elts)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_elts);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "List field \"elts\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
elts = _Ta3_asdl_seq_new(len, arena);
if (elts == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "List field \"elts\" changed size during iteration");
goto failed;
}
asdl_seq_SET(elts, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elts\" missing from List");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from List");
return 1;
}
*out = List(elts, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Tuple_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* elts;
expr_context_ty ctx;
if (_PyObject_HasAttrId(obj, &PyId_elts)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_elts);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Tuple field \"elts\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
elts = _Ta3_asdl_seq_new(len, arena);
if (elts == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Tuple field \"elts\" changed size during iteration");
goto failed;
}
asdl_seq_SET(elts, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"elts\" missing from Tuple");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_ctx)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_ctx);
if (tmp == NULL) goto failed;
res = obj2ast_expr_context(tmp, &ctx, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"ctx\" missing from Tuple");
return 1;
}
*out = Tuple(elts, ctx, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of expr, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 7985 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_keyword | obj2ast_keyword( PyObject * obj , keyword_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
identifier arg;
expr_ty value;
if (exists_not_none(obj, &PyId_arg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_arg);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &arg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
arg = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from keyword");
return 1;
}
*out = keyword(arg, value, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 193 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_keyword | obj2ast_keyword( PyObject * obj , keyword_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
identifier arg;
expr_ty value;
if (exists_not_none(obj, &PyId_arg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_arg);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &arg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
arg = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from keyword");
return 1;
}
*out = keyword(arg, value, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 193 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_mod | obj2ast_mod( PyObject * obj , mod_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
if (obj == Py_None) {
*out = NULL;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Module_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
asdl_seq* type_ignores;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Module field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Module field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Module");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_type_ignores)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_type_ignores);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Module field \"type_ignores\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
type_ignores = _Ta3_asdl_seq_new(len, arena);
if (type_ignores == NULL) goto failed;
for (i = 0; i < len; i++) {
type_ignore_ty value;
res = obj2ast_type_ignore(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Module field \"type_ignores\" changed size during iteration");
goto failed;
}
asdl_seq_SET(type_ignores, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"type_ignores\" missing from Module");
return 1;
}
*out = Module(body, type_ignores, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Interactive_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Interactive field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Interactive field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Interactive");
return 1;
}
*out = Interactive(body, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Expression_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty body;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &body, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Expression");
return 1;
}
*out = Expression(body, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)FunctionType_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* argtypes;
expr_ty returns;
if (_PyObject_HasAttrId(obj, &PyId_argtypes)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_argtypes);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "FunctionType field \"argtypes\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
argtypes = _Ta3_asdl_seq_new(len, arena);
if (argtypes == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "FunctionType field \"argtypes\" changed size during iteration");
goto failed;
}
asdl_seq_SET(argtypes, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"argtypes\" missing from FunctionType");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_returns)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_returns);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &returns, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"returns\" missing from FunctionType");
return 1;
}
*out = FunctionType(argtypes, returns, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Suite_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Suite field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Suite field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Suite");
return 1;
}
*out = Suite(body, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of mod, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 1421 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_mod | obj2ast_mod( PyObject * obj , mod_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
if (obj == Py_None) {
*out = NULL;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Module_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
asdl_seq* type_ignores;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Module field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Module field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Module");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_type_ignores)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_type_ignores);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Module field \"type_ignores\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
type_ignores = _Ta3_asdl_seq_new(len, arena);
if (type_ignores == NULL) goto failed;
for (i = 0; i < len; i++) {
type_ignore_ty value;
res = obj2ast_type_ignore(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Module field \"type_ignores\" changed size during iteration");
goto failed;
}
asdl_seq_SET(type_ignores, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"type_ignores\" missing from Module");
return 1;
}
*out = Module(body, type_ignores, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Interactive_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Interactive field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Interactive field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Interactive");
return 1;
}
*out = Interactive(body, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Expression_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty body;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &body, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Expression");
return 1;
}
*out = Expression(body, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)FunctionType_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* argtypes;
expr_ty returns;
if (_PyObject_HasAttrId(obj, &PyId_argtypes)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_argtypes);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "FunctionType field \"argtypes\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
argtypes = _Ta3_asdl_seq_new(len, arena);
if (argtypes == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "FunctionType field \"argtypes\" changed size during iteration");
goto failed;
}
asdl_seq_SET(argtypes, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"argtypes\" missing from FunctionType");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_returns)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_returns);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &returns, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"returns\" missing from FunctionType");
return 1;
}
*out = FunctionType(argtypes, returns, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Suite_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Suite field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Suite field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Suite");
return 1;
}
*out = Suite(body, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of mod, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 1421 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_slice | obj2ast_slice( PyObject * obj , slice_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
if (obj == Py_None) {
*out = NULL;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Slice_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty lower;
expr_ty upper;
expr_ty step;
if (exists_not_none(obj, &PyId_lower)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lower);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &lower, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
lower = NULL;
}
if (exists_not_none(obj, &PyId_upper)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_upper);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &upper, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
upper = NULL;
}
if (exists_not_none(obj, &PyId_step)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_step);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &step, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
step = NULL;
}
*out = Slice(lower, upper, step, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ExtSlice_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* dims;
if (_PyObject_HasAttrId(obj, &PyId_dims)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_dims);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ExtSlice field \"dims\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
dims = _Ta3_asdl_seq_new(len, arena);
if (dims == NULL) goto failed;
for (i = 0; i < len; i++) {
slice_ty value;
res = obj2ast_slice(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ExtSlice field \"dims\" changed size during iteration");
goto failed;
}
asdl_seq_SET(dims, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"dims\" missing from ExtSlice");
return 1;
}
*out = ExtSlice(dims, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Index_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Index");
return 1;
}
*out = Index(value, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of slice, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 699 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_slice | obj2ast_slice( PyObject * obj , slice_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
if (obj == Py_None) {
*out = NULL;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Slice_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty lower;
expr_ty upper;
expr_ty step;
if (exists_not_none(obj, &PyId_lower)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lower);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &lower, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
lower = NULL;
}
if (exists_not_none(obj, &PyId_upper)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_upper);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &upper, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
upper = NULL;
}
if (exists_not_none(obj, &PyId_step)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_step);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &step, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
step = NULL;
}
*out = Slice(lower, upper, step, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ExtSlice_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* dims;
if (_PyObject_HasAttrId(obj, &PyId_dims)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_dims);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ExtSlice field \"dims\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
dims = _Ta3_asdl_seq_new(len, arena);
if (dims == NULL) goto failed;
for (i = 0; i < len; i++) {
slice_ty value;
res = obj2ast_slice(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ExtSlice field \"dims\" changed size during iteration");
goto failed;
}
asdl_seq_SET(dims, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"dims\" missing from ExtSlice");
return 1;
}
*out = ExtSlice(dims, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Index_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Index");
return 1;
}
*out = Index(value, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of slice, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 699 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_stmt | obj2ast_stmt( PyObject * obj , stmt_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
int lineno;
int col_offset;
if (obj == Py_None) {
*out = NULL;
return 0;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from stmt");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from stmt");
return 1;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)FunctionDef_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier name;
arguments_ty args;
asdl_seq* body;
asdl_seq* decorator_list;
expr_ty returns;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from FunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
res = obj2ast_arguments(tmp, &args, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from FunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "FunctionDef field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "FunctionDef field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from FunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_decorator_list)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_decorator_list);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "FunctionDef field \"decorator_list\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
decorator_list = _Ta3_asdl_seq_new(len, arena);
if (decorator_list == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "FunctionDef field \"decorator_list\" changed size during iteration");
goto failed;
}
asdl_seq_SET(decorator_list, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"decorator_list\" missing from FunctionDef");
return 1;
}
if (exists_not_none(obj, &PyId_returns)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_returns);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &returns, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
returns = NULL;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = FunctionDef(name, args, body, decorator_list, returns,
type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AsyncFunctionDef_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier name;
arguments_ty args;
asdl_seq* body;
asdl_seq* decorator_list;
expr_ty returns;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from AsyncFunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
res = obj2ast_arguments(tmp, &args, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from AsyncFunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFunctionDef field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from AsyncFunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_decorator_list)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_decorator_list);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"decorator_list\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
decorator_list = _Ta3_asdl_seq_new(len, arena);
if (decorator_list == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFunctionDef field \"decorator_list\" changed size during iteration");
goto failed;
}
asdl_seq_SET(decorator_list, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"decorator_list\" missing from AsyncFunctionDef");
return 1;
}
if (exists_not_none(obj, &PyId_returns)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_returns);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &returns, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
returns = NULL;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = AsyncFunctionDef(name, args, body, decorator_list, returns,
type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ClassDef_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier name;
asdl_seq* bases;
asdl_seq* keywords;
asdl_seq* body;
asdl_seq* decorator_list;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_bases)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_bases);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"bases\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
bases = _Ta3_asdl_seq_new(len, arena);
if (bases == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"bases\" changed size during iteration");
goto failed;
}
asdl_seq_SET(bases, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"bases\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_keywords)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_keywords);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"keywords\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
keywords = _Ta3_asdl_seq_new(len, arena);
if (keywords == NULL) goto failed;
for (i = 0; i < len; i++) {
keyword_ty value;
res = obj2ast_keyword(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"keywords\" changed size during iteration");
goto failed;
}
asdl_seq_SET(keywords, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"keywords\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_decorator_list)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_decorator_list);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"decorator_list\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
decorator_list = _Ta3_asdl_seq_new(len, arena);
if (decorator_list == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"decorator_list\" changed size during iteration");
goto failed;
}
asdl_seq_SET(decorator_list, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"decorator_list\" missing from ClassDef");
return 1;
}
*out = ClassDef(name, bases, keywords, body, decorator_list, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Return_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (exists_not_none(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
value = NULL;
}
*out = Return(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Delete_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* targets;
if (_PyObject_HasAttrId(obj, &PyId_targets)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_targets);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Delete field \"targets\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
targets = _Ta3_asdl_seq_new(len, arena);
if (targets == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Delete field \"targets\" changed size during iteration");
goto failed;
}
asdl_seq_SET(targets, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"targets\" missing from Delete");
return 1;
}
*out = Delete(targets, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Assign_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* targets;
expr_ty value;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_targets)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_targets);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Assign field \"targets\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
targets = _Ta3_asdl_seq_new(len, arena);
if (targets == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Assign field \"targets\" changed size during iteration");
goto failed;
}
asdl_seq_SET(targets, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"targets\" missing from Assign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Assign");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = Assign(targets, value, type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AugAssign_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
operator_ty op;
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from AugAssign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_operator(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from AugAssign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from AugAssign");
return 1;
}
*out = AugAssign(target, op, value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AnnAssign_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
expr_ty annotation;
expr_ty value;
int simple;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from AnnAssign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_annotation)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_annotation);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &annotation, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"annotation\" missing from AnnAssign");
return 1;
}
if (exists_not_none(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
value = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_simple)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_simple);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &simple, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"simple\" missing from AnnAssign");
return 1;
}
*out = AnnAssign(target, annotation, value, simple, lineno, col_offset,
arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)For_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
expr_ty iter;
asdl_seq* body;
asdl_seq* orelse;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from For");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_iter)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_iter);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &iter, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"iter\" missing from For");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "For field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "For field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from For");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "For field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "For field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from For");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = For(target, iter, body, orelse, type_comment, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AsyncFor_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
expr_ty iter;
asdl_seq* body;
asdl_seq* orelse;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from AsyncFor");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_iter)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_iter);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &iter, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"iter\" missing from AsyncFor");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFor field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFor field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from AsyncFor");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFor field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFor field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from AsyncFor");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = AsyncFor(target, iter, body, orelse, type_comment, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)While_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
asdl_seq* body;
asdl_seq* orelse;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from While");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "While field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "While field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from While");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "While field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "While field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from While");
return 1;
}
*out = While(test, body, orelse, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)If_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
asdl_seq* body;
asdl_seq* orelse;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from If");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "If field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "If field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from If");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "If field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "If field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from If");
return 1;
}
*out = If(test, body, orelse, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)With_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* items;
asdl_seq* body;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_items)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_items);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "With field \"items\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
items = _Ta3_asdl_seq_new(len, arena);
if (items == NULL) goto failed;
for (i = 0; i < len; i++) {
withitem_ty value;
res = obj2ast_withitem(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "With field \"items\" changed size during iteration");
goto failed;
}
asdl_seq_SET(items, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"items\" missing from With");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "With field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "With field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from With");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = With(items, body, type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AsyncWith_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* items;
asdl_seq* body;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_items)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_items);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncWith field \"items\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
items = _Ta3_asdl_seq_new(len, arena);
if (items == NULL) goto failed;
for (i = 0; i < len; i++) {
withitem_ty value;
res = obj2ast_withitem(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncWith field \"items\" changed size during iteration");
goto failed;
}
asdl_seq_SET(items, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"items\" missing from AsyncWith");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncWith field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncWith field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from AsyncWith");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = AsyncWith(items, body, type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Raise_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty exc;
expr_ty cause;
if (exists_not_none(obj, &PyId_exc)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_exc);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &exc, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
exc = NULL;
}
if (exists_not_none(obj, &PyId_cause)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_cause);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &cause, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
cause = NULL;
}
*out = Raise(exc, cause, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Try_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
asdl_seq* handlers;
asdl_seq* orelse;
asdl_seq* finalbody;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Try");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_handlers)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_handlers);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"handlers\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
handlers = _Ta3_asdl_seq_new(len, arena);
if (handlers == NULL) goto failed;
for (i = 0; i < len; i++) {
excepthandler_ty value;
res = obj2ast_excepthandler(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"handlers\" changed size during iteration");
goto failed;
}
asdl_seq_SET(handlers, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"handlers\" missing from Try");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from Try");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_finalbody)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_finalbody);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"finalbody\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
finalbody = _Ta3_asdl_seq_new(len, arena);
if (finalbody == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"finalbody\" changed size during iteration");
goto failed;
}
asdl_seq_SET(finalbody, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"finalbody\" missing from Try");
return 1;
}
*out = Try(body, handlers, orelse, finalbody, lineno, col_offset,
arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Assert_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
expr_ty msg;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from Assert");
return 1;
}
if (exists_not_none(obj, &PyId_msg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_msg);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &msg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
msg = NULL;
}
*out = Assert(test, msg, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Import_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* names;
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Import field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
alias_ty value;
res = obj2ast_alias(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Import field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from Import");
return 1;
}
*out = Import(names, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ImportFrom_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier module;
asdl_seq* names;
int level;
if (exists_not_none(obj, &PyId_module)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_module);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &module, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
module = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ImportFrom field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
alias_ty value;
res = obj2ast_alias(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ImportFrom field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from ImportFrom");
return 1;
}
if (exists_not_none(obj, &PyId_level)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_level);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &level, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
level = 0;
}
*out = ImportFrom(module, names, level, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Global_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* names;
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Global field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
identifier value;
res = obj2ast_identifier(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Global field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from Global");
return 1;
}
*out = Global(names, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Nonlocal_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* names;
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Nonlocal field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
identifier value;
res = obj2ast_identifier(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Nonlocal field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from Nonlocal");
return 1;
}
*out = Nonlocal(names, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Expr_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Expr");
return 1;
}
*out = Expr(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Pass_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Pass(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Break_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Break(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Continue_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Continue(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of stmt, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 9994 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_stmt | obj2ast_stmt( PyObject * obj , stmt_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
int lineno;
int col_offset;
if (obj == Py_None) {
*out = NULL;
return 0;
}
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from stmt");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_col_offset)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_col_offset);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &col_offset, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from stmt");
return 1;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)FunctionDef_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier name;
arguments_ty args;
asdl_seq* body;
asdl_seq* decorator_list;
expr_ty returns;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from FunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
res = obj2ast_arguments(tmp, &args, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from FunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "FunctionDef field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "FunctionDef field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from FunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_decorator_list)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_decorator_list);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "FunctionDef field \"decorator_list\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
decorator_list = _Ta3_asdl_seq_new(len, arena);
if (decorator_list == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "FunctionDef field \"decorator_list\" changed size during iteration");
goto failed;
}
asdl_seq_SET(decorator_list, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"decorator_list\" missing from FunctionDef");
return 1;
}
if (exists_not_none(obj, &PyId_returns)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_returns);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &returns, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
returns = NULL;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = FunctionDef(name, args, body, decorator_list, returns,
type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AsyncFunctionDef_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier name;
arguments_ty args;
asdl_seq* body;
asdl_seq* decorator_list;
expr_ty returns;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from AsyncFunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_args)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_args);
if (tmp == NULL) goto failed;
res = obj2ast_arguments(tmp, &args, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"args\" missing from AsyncFunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFunctionDef field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from AsyncFunctionDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_decorator_list)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_decorator_list);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFunctionDef field \"decorator_list\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
decorator_list = _Ta3_asdl_seq_new(len, arena);
if (decorator_list == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFunctionDef field \"decorator_list\" changed size during iteration");
goto failed;
}
asdl_seq_SET(decorator_list, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"decorator_list\" missing from AsyncFunctionDef");
return 1;
}
if (exists_not_none(obj, &PyId_returns)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_returns);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &returns, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
returns = NULL;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = AsyncFunctionDef(name, args, body, decorator_list, returns,
type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ClassDef_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier name;
asdl_seq* bases;
asdl_seq* keywords;
asdl_seq* body;
asdl_seq* decorator_list;
if (_PyObject_HasAttrId(obj, &PyId_name)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_name);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &name, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"name\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_bases)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_bases);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"bases\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
bases = _Ta3_asdl_seq_new(len, arena);
if (bases == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"bases\" changed size during iteration");
goto failed;
}
asdl_seq_SET(bases, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"bases\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_keywords)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_keywords);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"keywords\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
keywords = _Ta3_asdl_seq_new(len, arena);
if (keywords == NULL) goto failed;
for (i = 0; i < len; i++) {
keyword_ty value;
res = obj2ast_keyword(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"keywords\" changed size during iteration");
goto failed;
}
asdl_seq_SET(keywords, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"keywords\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from ClassDef");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_decorator_list)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_decorator_list);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ClassDef field \"decorator_list\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
decorator_list = _Ta3_asdl_seq_new(len, arena);
if (decorator_list == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ClassDef field \"decorator_list\" changed size during iteration");
goto failed;
}
asdl_seq_SET(decorator_list, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"decorator_list\" missing from ClassDef");
return 1;
}
*out = ClassDef(name, bases, keywords, body, decorator_list, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Return_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (exists_not_none(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
value = NULL;
}
*out = Return(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Delete_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* targets;
if (_PyObject_HasAttrId(obj, &PyId_targets)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_targets);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Delete field \"targets\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
targets = _Ta3_asdl_seq_new(len, arena);
if (targets == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Delete field \"targets\" changed size during iteration");
goto failed;
}
asdl_seq_SET(targets, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"targets\" missing from Delete");
return 1;
}
*out = Delete(targets, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Assign_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* targets;
expr_ty value;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_targets)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_targets);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Assign field \"targets\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
targets = _Ta3_asdl_seq_new(len, arena);
if (targets == NULL) goto failed;
for (i = 0; i < len; i++) {
expr_ty value;
res = obj2ast_expr(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Assign field \"targets\" changed size during iteration");
goto failed;
}
asdl_seq_SET(targets, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"targets\" missing from Assign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Assign");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = Assign(targets, value, type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AugAssign_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
operator_ty op;
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from AugAssign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_op)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_op);
if (tmp == NULL) goto failed;
res = obj2ast_operator(tmp, &op, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"op\" missing from AugAssign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from AugAssign");
return 1;
}
*out = AugAssign(target, op, value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AnnAssign_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
expr_ty annotation;
expr_ty value;
int simple;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from AnnAssign");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_annotation)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_annotation);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &annotation, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"annotation\" missing from AnnAssign");
return 1;
}
if (exists_not_none(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
value = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_simple)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_simple);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &simple, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"simple\" missing from AnnAssign");
return 1;
}
*out = AnnAssign(target, annotation, value, simple, lineno, col_offset,
arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)For_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
expr_ty iter;
asdl_seq* body;
asdl_seq* orelse;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from For");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_iter)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_iter);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &iter, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"iter\" missing from For");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "For field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "For field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from For");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "For field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "For field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from For");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = For(target, iter, body, orelse, type_comment, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AsyncFor_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty target;
expr_ty iter;
asdl_seq* body;
asdl_seq* orelse;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_target)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_target);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &target, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"target\" missing from AsyncFor");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_iter)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_iter);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &iter, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"iter\" missing from AsyncFor");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFor field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFor field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from AsyncFor");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncFor field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncFor field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from AsyncFor");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = AsyncFor(target, iter, body, orelse, type_comment, lineno,
col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)While_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
asdl_seq* body;
asdl_seq* orelse;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from While");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "While field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "While field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from While");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "While field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "While field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from While");
return 1;
}
*out = While(test, body, orelse, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)If_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
asdl_seq* body;
asdl_seq* orelse;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from If");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "If field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "If field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from If");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "If field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "If field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from If");
return 1;
}
*out = If(test, body, orelse, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)With_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* items;
asdl_seq* body;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_items)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_items);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "With field \"items\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
items = _Ta3_asdl_seq_new(len, arena);
if (items == NULL) goto failed;
for (i = 0; i < len; i++) {
withitem_ty value;
res = obj2ast_withitem(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "With field \"items\" changed size during iteration");
goto failed;
}
asdl_seq_SET(items, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"items\" missing from With");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "With field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "With field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from With");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = With(items, body, type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)AsyncWith_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* items;
asdl_seq* body;
string type_comment;
if (_PyObject_HasAttrId(obj, &PyId_items)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_items);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncWith field \"items\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
items = _Ta3_asdl_seq_new(len, arena);
if (items == NULL) goto failed;
for (i = 0; i < len; i++) {
withitem_ty value;
res = obj2ast_withitem(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncWith field \"items\" changed size during iteration");
goto failed;
}
asdl_seq_SET(items, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"items\" missing from AsyncWith");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "AsyncWith field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "AsyncWith field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from AsyncWith");
return 1;
}
if (exists_not_none(obj, &PyId_type_comment)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_type_comment);
if (tmp == NULL) goto failed;
res = obj2ast_string(tmp, &type_comment, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
type_comment = NULL;
}
*out = AsyncWith(items, body, type_comment, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Raise_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty exc;
expr_ty cause;
if (exists_not_none(obj, &PyId_exc)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_exc);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &exc, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
exc = NULL;
}
if (exists_not_none(obj, &PyId_cause)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_cause);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &cause, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
cause = NULL;
}
*out = Raise(exc, cause, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Try_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* body;
asdl_seq* handlers;
asdl_seq* orelse;
asdl_seq* finalbody;
if (_PyObject_HasAttrId(obj, &PyId_body)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_body);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"body\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
body = _Ta3_asdl_seq_new(len, arena);
if (body == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"body\" changed size during iteration");
goto failed;
}
asdl_seq_SET(body, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"body\" missing from Try");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_handlers)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_handlers);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"handlers\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
handlers = _Ta3_asdl_seq_new(len, arena);
if (handlers == NULL) goto failed;
for (i = 0; i < len; i++) {
excepthandler_ty value;
res = obj2ast_excepthandler(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"handlers\" changed size during iteration");
goto failed;
}
asdl_seq_SET(handlers, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"handlers\" missing from Try");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_orelse)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_orelse);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"orelse\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
orelse = _Ta3_asdl_seq_new(len, arena);
if (orelse == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"orelse\" changed size during iteration");
goto failed;
}
asdl_seq_SET(orelse, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"orelse\" missing from Try");
return 1;
}
if (_PyObject_HasAttrId(obj, &PyId_finalbody)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_finalbody);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Try field \"finalbody\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
finalbody = _Ta3_asdl_seq_new(len, arena);
if (finalbody == NULL) goto failed;
for (i = 0; i < len; i++) {
stmt_ty value;
res = obj2ast_stmt(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Try field \"finalbody\" changed size during iteration");
goto failed;
}
asdl_seq_SET(finalbody, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"finalbody\" missing from Try");
return 1;
}
*out = Try(body, handlers, orelse, finalbody, lineno, col_offset,
arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Assert_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty test;
expr_ty msg;
if (_PyObject_HasAttrId(obj, &PyId_test)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_test);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &test, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"test\" missing from Assert");
return 1;
}
if (exists_not_none(obj, &PyId_msg)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_msg);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &msg, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
msg = NULL;
}
*out = Assert(test, msg, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Import_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* names;
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Import field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
alias_ty value;
res = obj2ast_alias(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Import field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from Import");
return 1;
}
*out = Import(names, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)ImportFrom_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
identifier module;
asdl_seq* names;
int level;
if (exists_not_none(obj, &PyId_module)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_module);
if (tmp == NULL) goto failed;
res = obj2ast_identifier(tmp, &module, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
module = NULL;
}
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "ImportFrom field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
alias_ty value;
res = obj2ast_alias(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "ImportFrom field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from ImportFrom");
return 1;
}
if (exists_not_none(obj, &PyId_level)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_level);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &level, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
level = 0;
}
*out = ImportFrom(module, names, level, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Global_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* names;
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Global field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
identifier value;
res = obj2ast_identifier(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Global field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from Global");
return 1;
}
*out = Global(names, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Nonlocal_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
asdl_seq* names;
if (_PyObject_HasAttrId(obj, &PyId_names)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
tmp = _PyObject_GetAttrId(obj, &PyId_names);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
PyErr_Format(PyExc_TypeError, "Nonlocal field \"names\" must be a list, not a %.200s", tmp->ob_type->tp_name);
goto failed;
}
len = PyList_GET_SIZE(tmp);
names = _Ta3_asdl_seq_new(len, arena);
if (names == NULL) goto failed;
for (i = 0; i < len; i++) {
identifier value;
res = obj2ast_identifier(PyList_GET_ITEM(tmp, i), &value, arena);
if (res != 0) goto failed;
if (len != PyList_GET_SIZE(tmp)) {
PyErr_SetString(PyExc_RuntimeError, "Nonlocal field \"names\" changed size during iteration");
goto failed;
}
asdl_seq_SET(names, i, value);
}
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"names\" missing from Nonlocal");
return 1;
}
*out = Nonlocal(names, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Expr_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
expr_ty value;
if (_PyObject_HasAttrId(obj, &PyId_value)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_value);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &value, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from Expr");
return 1;
}
*out = Expr(value, lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Pass_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Pass(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Break_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Break(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)Continue_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
*out = Continue(lineno, col_offset, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of stmt, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 9994 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_type_ignore | obj2ast_type_ignore( PyObject * obj , type_ignore_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
if (obj == Py_None) {
*out = NULL;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)TypeIgnore_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
int lineno;
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from TypeIgnore");
return 1;
}
*out = TypeIgnore(lineno, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of type_ignore, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 190 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_type_ignore | obj2ast_type_ignore( PyObject * obj , type_ignore_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* arena)
{
int isinstance;
PyObject *tmp = NULL;
if (obj == Py_None) {
*out = NULL;
return 0;
}
isinstance = PyObject_IsInstance(obj, (PyObject*)TypeIgnore_type);
if (isinstance == -1) {
return 1;
}
if (isinstance) {
int lineno;
if (_PyObject_HasAttrId(obj, &PyId_lineno)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_lineno);
if (tmp == NULL) goto failed;
res = obj2ast_int(tmp, &lineno, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from TypeIgnore");
return 1;
}
*out = TypeIgnore(lineno, arena);
if (*out == NULL) goto failed;
return 0;
}
PyErr_Format(PyExc_TypeError, "expected some sort of type_ignore, but got %R", obj);
failed:
Py_XDECREF(tmp);
return 1;
} | 190 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_withitem | obj2ast_withitem( PyObject * obj , withitem_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
expr_ty context_expr;
expr_ty optional_vars;
if (_PyObject_HasAttrId(obj, &PyId_context_expr)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_context_expr);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &context_expr, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"context_expr\" missing from withitem");
return 1;
}
if (exists_not_none(obj, &PyId_optional_vars)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_optional_vars);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &optional_vars, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
optional_vars = NULL;
}
*out = withitem(context_expr, optional_vars, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 193 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | obj2ast_withitem | obj2ast_withitem( PyObject * obj , withitem_ty * out , PyArena * arena) | ['obj', 'out', 'arena'] | obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena)
{
PyObject* tmp = NULL;
expr_ty context_expr;
expr_ty optional_vars;
if (_PyObject_HasAttrId(obj, &PyId_context_expr)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_context_expr);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &context_expr, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
PyErr_SetString(PyExc_TypeError, "required field \"context_expr\" missing from withitem");
return 1;
}
if (exists_not_none(obj, &PyId_optional_vars)) {
int res;
tmp = _PyObject_GetAttrId(obj, &PyId_optional_vars);
if (tmp == NULL) goto failed;
res = obj2ast_expr(tmp, &optional_vars, arena);
if (res != 0) goto failed;
Py_CLEAR(tmp);
} else {
optional_vars = NULL;
}
*out = withitem(context_expr, optional_vars, arena);
return 0;
failed:
Py_XDECREF(tmp);
return 1;
} | 193 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | FstringParser_ConcatFstring | FstringParser_ConcatFstring( FstringParser * state , const char ** str , const char * end , int raw , int recurse_lvl , struct compiling * c , const node * n) | ['state', 'str', 'end', 'raw', 'recurse_lvl', 'c', 'n'] | FstringParser_ConcatFstring(FstringParser *state, const char **str,
const char *end, int raw, int recurse_lvl,
struct compiling *c, const node *n)
{
FstringParser_check_invariants(state);
/* Parse the f-string. */
while (1) {
PyObject *literal = NULL;
expr_ty expression = NULL;
/* If there's a zero length literal in front of the
expression, literal will be NULL. If we're at the end of
the f-string, expression will be NULL (unless result == 1,
see below). */
int result = fstring_find_literal_and_expr(str, end, raw, recurse_lvl,
&literal, &expression,
c, n);
if (result < 0)
return -1;
/* Add the literal, if any. */
if (!literal) {
/* Do nothing. Just leave last_str alone (and possibly
NULL). */
} else if (!state->last_str) {
state->last_str = literal;
literal = NULL;
} else {
/* We have a literal, concatenate it. */
assert(PyUnicode_GET_LENGTH(literal) != 0);
if (FstringParser_ConcatAndDel(state, literal) < 0)
return -1;
literal = NULL;
}
assert(!state->last_str ||
PyUnicode_GET_LENGTH(state->last_str) != 0);
/* We've dealt with the literal now. It can't be leaked on further
errors. */
assert(literal == NULL);
/* See if we should just loop around to get the next literal
and expression, while ignoring the expression this
time. This is used for un-doubling braces, as an
optimization. */
if (result == 1)
continue;
if (!expression)
/* We're done with this f-string. */
break;
/* We know we have an expression. Convert any existing string
to a Str node. */
if (!state->last_str) {
/* Do nothing. No previous literal. */
} else {
/* Convert the existing last_str literal to a Str node. */
expr_ty str = make_str_node_and_del(&state->last_str, c, n);
if (!str || ExprList_Append(&state->expr_list, str) < 0)
return -1;
}
if (ExprList_Append(&state->expr_list, expression) < 0)
return -1;
}
/* If recurse_lvl is zero, then we must be at the end of the
string. Otherwise, we must be at a right brace. */
if (recurse_lvl == 0 && *str < end-1) {
ast_error(c, n, "f-string: unexpected end of string");
return -1;
}
if (recurse_lvl != 0 && **str != '}') {
ast_error(c, n, "f-string: expecting '}'");
return -1;
}
FstringParser_check_invariants(state);
return 0;
} | 316 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | FstringParser_ConcatFstring | FstringParser_ConcatFstring( FstringParser * state , const char ** str , const char * end , int raw , int recurse_lvl , struct compiling * c , const node * n) | ['state', 'str', 'end', 'raw', 'recurse_lvl', 'c', 'n'] | FstringParser_ConcatFstring(FstringParser *state, const char **str,
const char *end, int raw, int recurse_lvl,
struct compiling *c, const node *n)
{
FstringParser_check_invariants(state);
/* Parse the f-string. */
while (1) {
PyObject *literal = NULL;
expr_ty expression = NULL;
/* If there's a zero length literal in front of the
expression, literal will be NULL. If we're at the end of
the f-string, expression will be NULL (unless result == 1,
see below). */
int result = fstring_find_literal_and_expr(str, end, raw, recurse_lvl,
&literal, &expression,
c, n);
if (result < 0)
return -1;
/* Add the literal, if any. */
if (!literal) {
/* Do nothing. Just leave last_str alone (and possibly
NULL). */
} else if (!state->last_str) {
state->last_str = literal;
literal = NULL;
} else {
/* We have a literal, concatenate it. */
assert(PyUnicode_GET_LENGTH(literal) != 0);
if (FstringParser_ConcatAndDel(state, literal) < 0)
return -1;
literal = NULL;
}
assert(!state->last_str ||
PyUnicode_GET_LENGTH(state->last_str) != 0);
/* We've dealt with the literal now. It can't be leaked on further
errors. */
assert(literal == NULL);
/* See if we should just loop around to get the next literal
and expression, while ignoring the expression this
time. This is used for un-doubling braces, as an
optimization. */
if (result == 1)
continue;
if (!expression)
/* We're done with this f-string. */
break;
/* We know we have an expression. Convert any existing string
to a Str node. */
if (!state->last_str) {
/* Do nothing. No previous literal. */
} else {
/* Convert the existing last_str literal to a Str node. */
expr_ty str = make_str_node_and_del(&state->last_str, c, n);
if (!str || ExprList_Append(&state->expr_list, str) < 0)
return -1;
}
if (ExprList_Append(&state->expr_list, expression) < 0)
return -1;
}
/* If recurse_lvl is zero, then we must be at the end of the
string. Otherwise, we must be at a right brace. */
if (recurse_lvl == 0 && *str < end-1) {
ast_error(c, n, "f-string: unexpected end of string");
return -1;
}
if (recurse_lvl != 0 && **str != '}') {
ast_error(c, n, "f-string: expecting '}'");
return -1;
}
FstringParser_check_invariants(state);
return 0;
} | 316 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | FstringParser_Finish | FstringParser_Finish( FstringParser * state , struct compiling * c , const node * n) | ['state', 'c', 'n'] | FstringParser_Finish(FstringParser *state, struct compiling *c,
const node *n)
{
asdl_seq *seq;
FstringParser_check_invariants(state);
/* If we're just a constant string with no expressions, return
that. */
if(state->expr_list.size == 0) {
if (!state->last_str) {
/* Create a zero length string. */
state->last_str = PyUnicode_FromStringAndSize(NULL, 0);
if (!state->last_str)
goto error;
}
return make_str_node_and_del(&state->last_str, c, n);
}
/* Create a Str node out of last_str, if needed. It will be the
last node in our expression list. */
if (state->last_str) {
expr_ty str = make_str_node_and_del(&state->last_str, c, n);
if (!str || ExprList_Append(&state->expr_list, str) < 0)
goto error;
}
/* This has already been freed. */
assert(state->last_str == NULL);
seq = ExprList_Finish(&state->expr_list, c->c_arena);
if (!seq)
goto error;
/* If there's only one expression, return it. Otherwise, we need
to join them together. */
if (seq->size == 1)
return seq->elements[0];
return JoinedStr(seq, LINENO(n), n->n_col_offset, c->c_arena);
error:
FstringParser_Dealloc(state);
return NULL;
} | 201 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | FstringParser_Finish | FstringParser_Finish( FstringParser * state , struct compiling * c , const node * n) | ['state', 'c', 'n'] | FstringParser_Finish(FstringParser *state, struct compiling *c,
const node *n)
{
asdl_seq *seq;
FstringParser_check_invariants(state);
/* If we're just a constant string with no expressions, return
that. */
if(state->expr_list.size == 0) {
if (!state->last_str) {
/* Create a zero length string. */
state->last_str = PyUnicode_FromStringAndSize(NULL, 0);
if (!state->last_str)
goto error;
}
return make_str_node_and_del(&state->last_str, c, n);
}
/* Create a Str node out of last_str, if needed. It will be the
last node in our expression list. */
if (state->last_str) {
expr_ty str = make_str_node_and_del(&state->last_str, c, n);
if (!str || ExprList_Append(&state->expr_list, str) < 0)
goto error;
}
/* This has already been freed. */
assert(state->last_str == NULL);
seq = ExprList_Finish(&state->expr_list, c->c_arena);
if (!seq)
goto error;
/* If there's only one expression, return it. Otherwise, we need
to join them together. */
if (seq->size == 1)
return seq->elements[0];
return JoinedStr(seq, LINENO(n), n->n_col_offset, c->c_arena);
error:
FstringParser_Dealloc(state);
return NULL;
} | 201 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3AST_FromNode | Ta3AST_FromNode( const node * n , PyCompilerFlags * flags , const char * filename_str , int feature_version , PyArena * arena) | ['n', 'flags', 'filename_str', 'feature_version', 'arena'] | Ta3AST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename_str,
int feature_version, PyArena *arena)
{
mod_ty mod;
PyObject *filename;
filename = PyUnicode_DecodeFSDefault(filename_str);
if (filename == NULL)
return NULL;
mod = Ta3AST_FromNodeObject(n, flags, filename, feature_version, arena);
Py_DECREF(filename);
return mod;
} | 71 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3AST_FromNode | Ta3AST_FromNode( const node * n , PyCompilerFlags * flags , const char * filename_str , int feature_version , PyArena * arena) | ['n', 'flags', 'filename_str', 'feature_version', 'arena'] | Ta3AST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename_str,
int feature_version, PyArena *arena)
{
mod_ty mod;
PyObject *filename;
filename = PyUnicode_DecodeFSDefault(filename_str);
if (filename == NULL)
return NULL;
mod = Ta3AST_FromNodeObject(n, flags, filename, feature_version, arena);
Py_DECREF(filename);
return mod;
} | 71 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3AST_FromNodeObject | Ta3AST_FromNodeObject( const node * n , PyCompilerFlags * flags , PyObject * filename , int feature_version , PyArena * arena) | ['n', 'flags', 'filename', 'feature_version', 'arena'] | Ta3AST_FromNodeObject(const node *n, PyCompilerFlags *flags,
PyObject *filename, int feature_version,
PyArena *arena)
{
int i, j, k, num;
asdl_seq *stmts = NULL;
asdl_seq *type_ignores = NULL;
stmt_ty s;
node *ch;
struct compiling c;
mod_ty res = NULL;
asdl_seq *argtypes = NULL;
expr_ty ret, arg;
c.c_arena = arena;
/* borrowed reference */
c.c_filename = filename;
c.c_normalize = NULL;
c.c_normalize_args = NULL;
c.c_feature_version = feature_version;
if (TYPE(n) == encoding_decl)
n = CHILD(n, 0);
k = 0;
switch (TYPE(n)) {
case file_input:
stmts = _Ta3_asdl_seq_new(num_stmts(n), arena);
if (!stmts)
goto out;
for (i = 0; i < NCH(n) - 1; i++) {
ch = CHILD(n, i);
if (TYPE(ch) == NEWLINE)
continue;
REQ(ch, stmt);
num = num_stmts(ch);
if (num == 1) {
s = ast_for_stmt(&c, ch);
if (!s)
goto out;
asdl_seq_SET(stmts, k++, s);
}
else {
ch = CHILD(ch, 0);
REQ(ch, simple_stmt);
for (j = 0; j < num; j++) {
s = ast_for_stmt(&c, CHILD(ch, j * 2));
if (!s)
goto out;
asdl_seq_SET(stmts, k++, s);
}
}
}
/* Type ignores are stored under the ENDMARKER in file_input. */
ch = CHILD(n, NCH(n) - 1);
REQ(ch, ENDMARKER);
num = NCH(ch);
type_ignores = _Ta3_asdl_seq_new(num, arena);
if (!type_ignores)
goto out;
for (i = 0; i < num; i++) {
type_ignore_ty ti = TypeIgnore(LINENO(CHILD(ch, i)), arena);
if (!ti)
goto out;
asdl_seq_SET(type_ignores, i, ti);
}
res = Module(stmts, type_ignores, arena);
break;
case eval_input: {
expr_ty testlist_ast;
/* XXX Why not comp_for here? */
testlist_ast = ast_for_testlist(&c, CHILD(n, 0));
if (!testlist_ast)
goto out;
res = Expression(testlist_ast, arena);
break;
}
case single_input:
if (TYPE(CHILD(n, 0)) == NEWLINE) {
stmts = _Ta3_asdl_seq_new(1, arena);
if (!stmts)
goto out;
asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
arena));
if (!asdl_seq_GET(stmts, 0))
goto out;
res = Interactive(stmts, arena);
}
else {
n = CHILD(n, 0);
num = num_stmts(n);
stmts = _Ta3_asdl_seq_new(num, arena);
if (!stmts)
goto out;
if (num == 1) {
s = ast_for_stmt(&c, n);
if (!s)
goto out;
asdl_seq_SET(stmts, 0, s);
}
else {
/* Only a simple_stmt can contain multiple statements. */
REQ(n, simple_stmt);
for (i = 0; i < NCH(n); i += 2) {
if (TYPE(CHILD(n, i)) == NEWLINE)
break;
s = ast_for_stmt(&c, CHILD(n, i));
if (!s)
goto out;
asdl_seq_SET(stmts, i / 2, s);
}
}
res = Interactive(stmts, arena);
}
break;
case func_type_input:
n = CHILD(n, 0);
REQ(n, func_type);
if (TYPE(CHILD(n, 1)) == typelist) {
ch = CHILD(n, 1);
/* this is overly permissive -- we don't pay any attention to
* stars on the args -- just parse them into an ordered list */
num = 0;
for (i = 0; i < NCH(ch); i++) {
if (TYPE(CHILD(ch, i)) == test)
num++;
}
argtypes = _Ta3_asdl_seq_new(num, arena);
j = 0;
for (i = 0; i < NCH(ch); i++) {
if (TYPE(CHILD(ch, i)) == test) {
arg = ast_for_expr(&c, CHILD(ch, i));
if (!arg)
goto out;
asdl_seq_SET(argtypes, j++, arg);
}
}
}
else
argtypes = _Ta3_asdl_seq_new(0, arena);
ret = ast_for_expr(&c, CHILD(n, NCH(n) - 1));
if (!ret)
goto out;
res = FunctionType(argtypes, ret, arena);
break;
default:
PyErr_Format(PyExc_SystemError,
"invalid node %d for Ta3AST_FromNode", TYPE(n));
goto out;
}
out:
if (c.c_normalize) {
Py_DECREF(c.c_normalize);
PyTuple_SET_ITEM(c.c_normalize_args, 1, NULL);
Py_DECREF(c.c_normalize_args);
}
return res;
} | 973 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | Ta3AST_FromNodeObject | Ta3AST_FromNodeObject( const node * n , PyCompilerFlags * flags , PyObject * filename , int feature_version , PyArena * arena) | ['n', 'flags', 'filename', 'feature_version', 'arena'] | Ta3AST_FromNodeObject(const node *n, PyCompilerFlags *flags,
PyObject *filename, int feature_version,
PyArena *arena)
{
int i, j, k, num;
asdl_seq *stmts = NULL;
asdl_seq *type_ignores = NULL;
stmt_ty s;
node *ch;
struct compiling c;
mod_ty res = NULL;
asdl_seq *argtypes = NULL;
expr_ty ret, arg;
c.c_arena = arena;
/* borrowed reference */
c.c_filename = filename;
c.c_normalize = NULL;
c.c_normalize_args = NULL;
c.c_feature_version = feature_version;
if (TYPE(n) == encoding_decl)
n = CHILD(n, 0);
k = 0;
switch (TYPE(n)) {
case file_input:
stmts = _Ta3_asdl_seq_new(num_stmts(n), arena);
if (!stmts)
goto out;
for (i = 0; i < NCH(n) - 1; i++) {
ch = CHILD(n, i);
if (TYPE(ch) == NEWLINE)
continue;
REQ(ch, stmt);
num = num_stmts(ch);
if (num == 1) {
s = ast_for_stmt(&c, ch);
if (!s)
goto out;
asdl_seq_SET(stmts, k++, s);
}
else {
ch = CHILD(ch, 0);
REQ(ch, simple_stmt);
for (j = 0; j < num; j++) {
s = ast_for_stmt(&c, CHILD(ch, j * 2));
if (!s)
goto out;
asdl_seq_SET(stmts, k++, s);
}
}
}
/* Type ignores are stored under the ENDMARKER in file_input. */
ch = CHILD(n, NCH(n) - 1);
REQ(ch, ENDMARKER);
num = NCH(ch);
type_ignores = _Ta3_asdl_seq_new(num, arena);
if (!type_ignores)
goto out;
for (i = 0; i < num; i++) {
type_ignore_ty ti = TypeIgnore(LINENO(CHILD(ch, i)), arena);
if (!ti)
goto out;
asdl_seq_SET(type_ignores, i, ti);
}
res = Module(stmts, type_ignores, arena);
break;
case eval_input: {
expr_ty testlist_ast;
/* XXX Why not comp_for here? */
testlist_ast = ast_for_testlist(&c, CHILD(n, 0));
if (!testlist_ast)
goto out;
res = Expression(testlist_ast, arena);
break;
}
case single_input:
if (TYPE(CHILD(n, 0)) == NEWLINE) {
stmts = _Ta3_asdl_seq_new(1, arena);
if (!stmts)
goto out;
asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,
arena));
if (!asdl_seq_GET(stmts, 0))
goto out;
res = Interactive(stmts, arena);
}
else {
n = CHILD(n, 0);
num = num_stmts(n);
stmts = _Ta3_asdl_seq_new(num, arena);
if (!stmts)
goto out;
if (num == 1) {
s = ast_for_stmt(&c, n);
if (!s)
goto out;
asdl_seq_SET(stmts, 0, s);
}
else {
/* Only a simple_stmt can contain multiple statements. */
REQ(n, simple_stmt);
for (i = 0; i < NCH(n); i += 2) {
if (TYPE(CHILD(n, i)) == NEWLINE)
break;
s = ast_for_stmt(&c, CHILD(n, i));
if (!s)
goto out;
asdl_seq_SET(stmts, i / 2, s);
}
}
res = Interactive(stmts, arena);
}
break;
case func_type_input:
n = CHILD(n, 0);
REQ(n, func_type);
if (TYPE(CHILD(n, 1)) == typelist) {
ch = CHILD(n, 1);
/* this is overly permissive -- we don't pay any attention to
* stars on the args -- just parse them into an ordered list */
num = 0;
for (i = 0; i < NCH(ch); i++) {
if (TYPE(CHILD(ch, i)) == test)
num++;
}
argtypes = _Ta3_asdl_seq_new(num, arena);
j = 0;
for (i = 0; i < NCH(ch); i++) {
if (TYPE(CHILD(ch, i)) == test) {
arg = ast_for_expr(&c, CHILD(ch, i));
if (!arg)
goto out;
asdl_seq_SET(argtypes, j++, arg);
}
}
}
else
argtypes = _Ta3_asdl_seq_new(0, arena);
ret = ast_for_expr(&c, CHILD(n, NCH(n) - 1));
if (!ret)
goto out;
res = FunctionType(argtypes, ret, arena);
break;
default:
PyErr_Format(PyExc_SystemError,
"invalid node %d for Ta3AST_FromNode", TYPE(n));
goto out;
}
out:
if (c.c_normalize) {
Py_DECREF(c.c_normalize);
PyTuple_SET_ITEM(c.c_normalize_args, 1, NULL);
Py_DECREF(c.c_normalize_args);
}
return res;
} | 973 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_for_arguments | ast_for_arguments( struct compiling * c , const node * n) | ['c', 'n'] | ast_for_arguments(struct compiling *c, const node *n)
{
/* This function handles both typedargslist (function definition)
and varargslist (lambda definition).
parameters: '(' [typedargslist] ')'
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [
'*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]]
| '**' tfpdef [',']]]
| '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]]
| '**' tfpdef [','])
tfpdef: NAME [':' test]
varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [
'*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]]
| '**' vfpdef [',']]]
| '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]]
| '**' vfpdef [',']
)
vfpdef: NAME
*/
int i, j, k, nposargs = 0, nkwonlyargs = 0;
int nposdefaults = 0, found_default = 0;
asdl_seq *posargs, *posdefaults, *kwonlyargs, *kwdefaults;
arg_ty vararg = NULL, kwarg = NULL;
arg_ty arg;
node *ch;
if (TYPE(n) == parameters) {
if (NCH(n) == 2) /* () as argument list */
return arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
n = CHILD(n, 1);
}
assert(TYPE(n) == typedargslist || TYPE(n) == varargslist);
/* First count the number of positional args & defaults. The
variable i is the loop index for this for loop and the next.
The next loop picks up where the first leaves off.
*/
for (i = 0; i < NCH(n); i++) {
ch = CHILD(n, i);
if (TYPE(ch) == STAR) {
/* skip star */
i++;
if (i < NCH(n) && /* skip argument following star */
(TYPE(CHILD(n, i)) == tfpdef ||
TYPE(CHILD(n, i)) == vfpdef)) {
i++;
}
break;
}
if (TYPE(ch) == DOUBLESTAR) break;
if (TYPE(ch) == vfpdef || TYPE(ch) == tfpdef) nposargs++;
if (TYPE(ch) == EQUAL) nposdefaults++;
}
/* count the number of keyword only args &
defaults for keyword only args */
for ( ; i < NCH(n); ++i) {
ch = CHILD(n, i);
if (TYPE(ch) == DOUBLESTAR) break;
if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++;
}
posargs = (nposargs ? _Ta3_asdl_seq_new(nposargs, c->c_arena) : NULL);
if (!posargs && nposargs)
return NULL;
kwonlyargs = (nkwonlyargs ?
_Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
if (!kwonlyargs && nkwonlyargs)
return NULL;
posdefaults = (nposdefaults ?
_Ta3_asdl_seq_new(nposdefaults, c->c_arena) : NULL);
if (!posdefaults && nposdefaults)
return NULL;
/* The length of kwonlyargs and kwdefaults are same
since we set NULL as default for keyword only argument w/o default
- we have sequence data structure, but no dictionary */
kwdefaults = (nkwonlyargs ?
_Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
if (!kwdefaults && nkwonlyargs)
return NULL;
if (nposargs + nkwonlyargs > 255) {
ast_error(c, n, "more than 255 arguments");
return NULL;
}
/* tfpdef: NAME [':' test]
vfpdef: NAME
*/
i = 0;
j = 0; /* index for defaults */
k = 0; /* index for args */
while (i < NCH(n)) {
ch = CHILD(n, i);
switch (TYPE(ch)) {
case tfpdef:
case vfpdef:
/* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is
anything other than EQUAL or a comma? */
/* XXX Should NCH(n) check be made a separate check? */
if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
expr_ty expression = ast_for_expr(c, CHILD(n, i + 2));
if (!expression)
return NULL;
assert(posdefaults != NULL);
asdl_seq_SET(posdefaults, j++, expression);
i += 2;
found_default = 1;
}
else if (found_default) {
ast_error(c, n,
"non-default argument follows default argument");
return NULL;
}
arg = ast_for_arg(c, ch);
if (!arg)
return NULL;
asdl_seq_SET(posargs, k++, arg);
i += 1; /* the name */
if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA)
i += 1; /* the comma, if present */
break;
case STAR:
if (i+1 >= NCH(n) ||
(i+2 == NCH(n) && (TYPE(CHILD(n, i+1)) == COMMA
|| TYPE(CHILD(n, i+1)) == TYPE_COMMENT))) {
ast_error(c, CHILD(n, i),
"named arguments must follow bare *");
return NULL;
}
ch = CHILD(n, i+1); /* tfpdef or COMMA */
if (TYPE(ch) == COMMA) {
int res = 0;
i += 2; /* now follows keyword only arguments */
if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) {
ast_error(c, CHILD(n, i),
"bare * has associated type comment");
return NULL;
}
res = handle_keywordonly_args(c, n, i,
kwonlyargs, kwdefaults);
if (res == -1) return NULL;
i = res; /* res has new position to process */
}
else {
vararg = ast_for_arg(c, ch);
if (!vararg)
return NULL;
i += 2; /* the star and the name */
if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA)
i += 1; /* the comma, if present */
if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) {
vararg->type_comment = NEW_TYPE_COMMENT(CHILD(n, i));
i += 1;
}
if (i < NCH(n) && (TYPE(CHILD(n, i)) == tfpdef
|| TYPE(CHILD(n, i)) == vfpdef)) {
int res = 0;
res = handle_keywordonly_args(c, n, i,
kwonlyargs, kwdefaults);
if (res == -1) return NULL;
i = res; /* res has new position to process */
}
}
break;
case DOUBLESTAR:
ch = CHILD(n, i+1); /* tfpdef */
assert(TYPE(ch) == tfpdef || TYPE(ch) == vfpdef);
kwarg = ast_for_arg(c, ch);
if (!kwarg)
return NULL;
i += 2; /* the double star and the name */
if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA)
i += 1; /* the comma, if present */
break;
case TYPE_COMMENT:
assert(i);
if (kwarg)
arg = kwarg;
/* arg will be equal to the last argument processed */
arg->type_comment = NEW_TYPE_COMMENT(ch);
i += 1;
break;
default:
PyErr_Format(PyExc_SystemError,
"unexpected node in varargslist: %d @ %d",
TYPE(ch), i);
return NULL;
}
}
return arguments(posargs, vararg, kwonlyargs, kwdefaults, kwarg, posdefaults, c->c_arena);
} | 1129 | True | 1 |
|
CVE-2019-19275 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has an ast_for_arguments out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_for_arguments | ast_for_arguments( struct compiling * c , const node * n) | ['c', 'n'] | ast_for_arguments(struct compiling *c, const node *n)
{
/* This function handles both typedargslist (function definition)
and varargslist (lambda definition).
parameters: '(' [typedargslist] ')'
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [
'*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]]
| '**' tfpdef [',']]]
| '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]]
| '**' tfpdef [','])
tfpdef: NAME [':' test]
varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [
'*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]]
| '**' vfpdef [',']]]
| '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]]
| '**' vfpdef [',']
)
vfpdef: NAME
*/
int i, j, k, nposargs = 0, nkwonlyargs = 0;
int nposdefaults = 0, found_default = 0;
asdl_seq *posargs, *posdefaults, *kwonlyargs, *kwdefaults;
arg_ty vararg = NULL, kwarg = NULL;
arg_ty arg;
node *ch;
if (TYPE(n) == parameters) {
if (NCH(n) == 2) /* () as argument list */
return arguments(NULL, NULL, NULL, NULL, NULL, NULL, c->c_arena);
n = CHILD(n, 1);
}
assert(TYPE(n) == typedargslist || TYPE(n) == varargslist);
/* First count the number of positional args & defaults. The
variable i is the loop index for this for loop and the next.
The next loop picks up where the first leaves off.
*/
for (i = 0; i < NCH(n); i++) {
ch = CHILD(n, i);
if (TYPE(ch) == STAR) {
/* skip star */
i++;
if (i < NCH(n) && /* skip argument following star */
(TYPE(CHILD(n, i)) == tfpdef ||
TYPE(CHILD(n, i)) == vfpdef)) {
i++;
}
break;
}
if (TYPE(ch) == DOUBLESTAR) break;
if (TYPE(ch) == vfpdef || TYPE(ch) == tfpdef) nposargs++;
if (TYPE(ch) == EQUAL) nposdefaults++;
}
/* count the number of keyword only args &
defaults for keyword only args */
for ( ; i < NCH(n); ++i) {
ch = CHILD(n, i);
if (TYPE(ch) == DOUBLESTAR) break;
if (TYPE(ch) == tfpdef || TYPE(ch) == vfpdef) nkwonlyargs++;
}
posargs = (nposargs ? _Ta3_asdl_seq_new(nposargs, c->c_arena) : NULL);
if (!posargs && nposargs)
return NULL;
kwonlyargs = (nkwonlyargs ?
_Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
if (!kwonlyargs && nkwonlyargs)
return NULL;
posdefaults = (nposdefaults ?
_Ta3_asdl_seq_new(nposdefaults, c->c_arena) : NULL);
if (!posdefaults && nposdefaults)
return NULL;
/* The length of kwonlyargs and kwdefaults are same
since we set NULL as default for keyword only argument w/o default
- we have sequence data structure, but no dictionary */
kwdefaults = (nkwonlyargs ?
_Ta3_asdl_seq_new(nkwonlyargs, c->c_arena) : NULL);
if (!kwdefaults && nkwonlyargs)
return NULL;
if (nposargs + nkwonlyargs > 255) {
ast_error(c, n, "more than 255 arguments");
return NULL;
}
/* tfpdef: NAME [':' test]
vfpdef: NAME
*/
i = 0;
j = 0; /* index for defaults */
k = 0; /* index for args */
while (i < NCH(n)) {
ch = CHILD(n, i);
switch (TYPE(ch)) {
case tfpdef:
case vfpdef:
/* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is
anything other than EQUAL or a comma? */
/* XXX Should NCH(n) check be made a separate check? */
if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
expr_ty expression = ast_for_expr(c, CHILD(n, i + 2));
if (!expression)
return NULL;
assert(posdefaults != NULL);
asdl_seq_SET(posdefaults, j++, expression);
i += 2;
found_default = 1;
}
else if (found_default) {
ast_error(c, n,
"non-default argument follows default argument");
return NULL;
}
arg = ast_for_arg(c, ch);
if (!arg)
return NULL;
asdl_seq_SET(posargs, k++, arg);
i += 1; /* the name */
if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA)
i += 1; /* the comma, if present */
break;
case STAR:
if (i+1 >= NCH(n) ||
(i+2 == NCH(n) && (TYPE(CHILD(n, i+1)) == COMMA
|| TYPE(CHILD(n, i+1)) == TYPE_COMMENT))) {
ast_error(c, CHILD(n, i),
"named arguments must follow bare *");
return NULL;
}
ch = CHILD(n, i+1); /* tfpdef or COMMA */
if (TYPE(ch) == COMMA) {
int res = 0;
i += 2; /* now follows keyword only arguments */
if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) {
ast_error(c, CHILD(n, i),
"bare * has associated type comment");
return NULL;
}
res = handle_keywordonly_args(c, n, i,
kwonlyargs, kwdefaults);
if (res == -1) return NULL;
i = res; /* res has new position to process */
}
else {
vararg = ast_for_arg(c, ch);
if (!vararg)
return NULL;
i += 2; /* the star and the name */
if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA)
i += 1; /* the comma, if present */
if (i < NCH(n) && TYPE(CHILD(n, i)) == TYPE_COMMENT) {
vararg->type_comment = NEW_TYPE_COMMENT(CHILD(n, i));
i += 1;
}
if (i < NCH(n) && (TYPE(CHILD(n, i)) == tfpdef
|| TYPE(CHILD(n, i)) == vfpdef)) {
int res = 0;
res = handle_keywordonly_args(c, n, i,
kwonlyargs, kwdefaults);
if (res == -1) return NULL;
i = res; /* res has new position to process */
}
}
break;
case DOUBLESTAR:
ch = CHILD(n, i+1); /* tfpdef */
assert(TYPE(ch) == tfpdef || TYPE(ch) == vfpdef);
kwarg = ast_for_arg(c, ch);
if (!kwarg)
return NULL;
i += 2; /* the double star and the name */
if (i < NCH(n) && TYPE(CHILD(n, i)) == COMMA)
i += 1; /* the comma, if present */
break;
case TYPE_COMMENT:
assert(i);
if (kwarg)
arg = kwarg;
/* arg will be equal to the last argument processed */
arg->type_comment = NEW_TYPE_COMMENT(ch);
i += 1;
break;
default:
PyErr_Format(PyExc_SystemError,
"unexpected node in varargslist: %d @ %d",
TYPE(ch), i);
return NULL;
}
}
return arguments(posargs, vararg, kwonlyargs, kwdefaults, kwarg, posdefaults, c->c_arena);
} | 1129 | True | 1 |
|
CVE-2019-19274 | False | False | False | False | AV:N/AC:L/Au:N/C:N/I:N/A:P | NETWORK | LOW | NONE | NONE | NONE | PARTIAL | 5.0 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | NETWORK | LOW | NONE | NONE | UNCHANGED | NONE | NONE | HIGH | 7.5 | HIGH | 3.9 | 3.6 | False | [{'url': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'name': 'https://github.com/python/typed_ast/commit/156afcb26c198e162504a57caddfe0acd9ed7dce', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'name': 'https://github.com/python/typed_ast/commit/dc317ac9cff859aa84eeabe03fb5004982545b3b', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'name': 'https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'name': 'https://github.com/python/cpython/commit/a4d78362397fc3bced6ea80fbc7b5f4827aec55e', 'refsource': 'MISC', 'tags': ['Patch', 'Third Party Advisory']}, {'url': 'https://bugs.python.org/issue36495', 'name': 'https://bugs.python.org/issue36495', 'refsource': 'MISC', 'tags': ['Patch', 'Vendor Advisory']}, {'url': 'https://lists.fedoraproject.org/archives/list/[email protected]/message/LG5H4Q6LFVRX7SFXLBEJMNQFI4T5SCEA/', 'name': 'FEDORA-2020-9b3dabc21c', 'refsource': 'FEDORA', 'tags': []}] | [{'description': [{'lang': 'en', 'value': 'CWE-125'}]}] | MEDIUM | [{'operator': 'OR', 'children': [], 'cpe_match': [{'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.1:*:*:*:*:*:*:*', 'cpe_name': []}, {'vulnerable': True, 'cpe23Uri': 'cpe:2.3:a:python:typed_ast:1.3.0:*:*:*:*:*:*:*', 'cpe_name': []}]}] | [{'lang': 'en', 'value': 'typed_ast 1.3.0 and 1.3.1 has a handle_keywordonly_args out-of-bounds read. An attacker with the ability to cause a Python interpreter to parse Python source (but not necessarily execute it) may be able to crash the interpreter process. This could be a concern, for example, in a web-based service that parses (but does not execute) Python code. (This issue also affected certain Python 3.8.0-alpha prereleases.)'}] | 2020-03-14T02:15Z | 2019-11-26T15:15Z | Out-of-bounds Read | The software reads data past the end, or before the beginning, of the intended buffer. | Typically, this can allow attackers to read sensitive information from other memory locations or cause a crash. A crash can occur when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string. The expected sentinel might not be located in the out-of-bounds memory, causing excessive data to be read, leading to a segmentation fault or a buffer overflow. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent read operation then produces undefined or unexpected results.
| https://cwe.mitre.org/data/definitions/125.html | 0 | Guido van Rossum | 2019-01-22 19:09:26-08:00 | Fully incorporate the code from Python 3.7.2 (#78)
This is a full port, following the recipe in update_process.md. I've also tried to keep the recipe up to date and improved the automation (see tools/script). I haven't cleaned up the commits. As of #77 there are a few tests that sanity-check this (though it's far from a full test suite), and they're run by Travis-CI and AppVeyor. | 156afcb26c198e162504a57caddfe0acd9ed7dce | False | python/typed_ast | Modified fork of CPython's ast module that parses `# type:` comments | 2016-02-16 22:40:09 | 2022-07-15 06:04:03 | python | 212.0 | 53.0 | ast_for_async_funcdef | ast_for_async_funcdef( struct compiling * c , const node * n , asdl_seq * decorator_seq) | ['c', 'n', 'decorator_seq'] | ast_for_async_funcdef(struct compiling *c, const node *n, asdl_seq *decorator_seq)
{
/* async_funcdef: ASYNC funcdef */
REQ(n, async_funcdef);
REQ(CHILD(n, 0), ASYNC);
REQ(CHILD(n, 1), funcdef);
return ast_for_funcdef_impl(c, CHILD(n, 1), decorator_seq,
1 /* is_async */);
} | 66 | True | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.